2620: GEPS 031: Python 3 support - 3.2

round 2 for python 3 support:
* no more cmp, also not in sort and sorted
* bsddb needs bytestring keys
* gtk does not need utf-8 encoded anymore...


svn: r20658
This commit is contained in:
Benny Malengier
2012-11-15 08:08:31 +00:00
parent b9aafe5b49
commit 8b39b80dc8
45 changed files with 596 additions and 419 deletions

View File

@@ -1089,10 +1089,12 @@ class PluginRegister(object):
continue
lenpd = len(self.__plugindata)
full_filename = os.path.join(dir, filename)
if sys.version_info[0] < 3:
full_filename = full_filename.encode(sys.getfilesystemencoding())
local_gettext = get_addon_translator(full_filename).gettext
try:
#execfile(full_filename,
exec(compile(open(full_filename.encode(sys.getfilesystemencoding())).read(), full_filename.encode(sys.getfilesystemencoding()), 'exec'),
exec(compile(open(full_filename).read(), full_filename, 'exec'),
make_environment(_=local_gettext),
{})
except ValueError as msg: