Fix T61332: Python3 syntax errors
This commit is contained in:
parent
191b8951f7
commit
7262ac6202
Notes:
blender-bot
2023-02-14 08:08:54 +01:00
Referenced by issue #61349, Debug Assert in init_edge(edgehash.c): Occurs when importing a glTF asset Referenced by issue #61332, Python 3 syntax errors
|
@ -29,7 +29,7 @@ try:
|
|||
os.remove(package_archive)
|
||||
if os.path.exists(package_dir):
|
||||
shutil.rmtree(package_dir)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
sys.stderr.write('Failed to clean up old package files: ' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
|
@ -40,7 +40,7 @@ try:
|
|||
for f in os.listdir(package_dir):
|
||||
if f.startswith('makes'):
|
||||
os.remove(os.path.join(package_dir, f))
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
sys.stderr.write('Failed to copy install directory: ' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
|
@ -58,13 +58,13 @@ try:
|
|||
sys.exit(-1)
|
||||
|
||||
subprocess.call(archive_cmd)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
sys.stderr.write('Failed to create package archive: ' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
# empty temporary package dir
|
||||
try:
|
||||
shutil.rmtree(package_dir)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
sys.stderr.write('Failed to clean up package directory: ' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
|
|
@ -39,8 +39,8 @@ defs = """
|
|||
SPACEICONMAX
|
||||
"""
|
||||
|
||||
print '\tmod = PyModule_New("dummy");'
|
||||
print '\tPyModule_AddObject(submodule, "key", mod);'
|
||||
print('\tmod = PyModule_New("dummy");')
|
||||
print('\tPyModule_AddObject(submodule, "key", mod);')
|
||||
|
||||
for d in defs.split('\n'):
|
||||
|
||||
|
@ -60,4 +60,4 @@ for d in defs.split('\n'):
|
|||
val = w[0]
|
||||
py_val = w[0]
|
||||
|
||||
print '\tPyModule_AddObject(mod, "%s", PyLong_FromSize_t(%s));' % (val, py_val)
|
||||
print('\tPyModule_AddObject(mod, "%s", PyLong_FromSize_t(%s));' % (val, py_val))
|
||||
|
|
Loading…
Reference in New Issue