Remove Python 2 compatibility code

Python 2 support was removed recently, so we don't need the
compatibility code anymore.
This commit is contained in:
Ekin Dursun
2023-11-12 21:01:31 +03:00
parent 4f94d61d84
commit c49dd0cf60
3 changed files with 23 additions and 44 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# Copyright (c) 2007, 2008 Rocco Rutte <pdmef@gmx.net> and others.
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
@@ -12,13 +12,6 @@ import os
import sys
import subprocess
PY2 = sys.version_info.major < 3
if PY2:
str = unicode
fsencode = lambda s: s.encode(sys.getfilesystemencoding())
else:
from os import fsencode
# default git branch name
cfg_master=b'master'
# default origin name
@@ -44,7 +37,7 @@ def setup_repo(url):
myui.setconfig(b'ui', b'interactive', b'off')
# Avoids a warning when the repository has obsolete markers
myui.setconfig(b'experimental', b'evolution.createmarkers', True)
return myui,hg.repository(myui, fsencode(url)).unfiltered()
return myui,hg.repository(myui, os.fsencode(url)).unfiltered()
def fixup_user(user,authors):
user=user.strip(b"\"")