Change the following to replace Python 2 code with Python 3:

1) Replace the deprecated unit test method.
2) Wraps filter usage in a list call.
3) Converts the old metaclass syntax to new.
4) Use range instead of xrange method.
5) Change Unicode to str.
6) Several other transformations.
7) Fixed change password test cases.
8) Use simplejson instead of plain JSON.
This commit is contained in:
Cyril Jouve
2020-08-31 16:45:31 +05:30
committed by Akshay Joshi
parent 11d5613866
commit 5a253f9053
385 changed files with 938 additions and 944 deletions

View File

@@ -235,7 +235,7 @@ else:
return _path
def document_dir():
return os.path.realpath(os.path.expanduser(u'~/'))
return os.path.realpath(os.path.expanduser('~/'))
def get_complete_file_path(file):
@@ -257,7 +257,7 @@ def get_complete_file_path(file):
if storage_dir:
file = os.path.join(
storage_dir,
file.lstrip(u'/').lstrip(u'\\')
file.lstrip('/').lstrip('\\')
)
if IS_WIN:
file = file.replace('\\', '/')
@@ -273,8 +273,8 @@ def does_utility_exist(file):
"""
error_msg = None
if not os.path.exists(file):
error_msg = gettext(u"'%s' file not found. Please correct the Binary"
u" Path in the Preferences dialog" % file)
error_msg = gettext("'%s' file not found. Please correct the Binary"
" Path in the Preferences dialog" % file)
return error_msg