[Bf-blender-cvs] [7262ac6202e] master: Fix T61332: Python3 syntax errors

Jacques Lucke noreply at git.blender.org
Sat Feb 9 03:13:08 CET 2019


Commit: 7262ac6202eb9258293473f35a24f375f9d6f635
Author: Jacques Lucke
Date:   Sat Feb 9 13:07:34 2019 +1100
Branches: master
https://developer.blender.org/rB7262ac6202eb9258293473f35a24f375f9d6f635

Fix T61332: Python3 syntax errors

===================================================================

M	build_files/package_spec/build_archive.py
M	source/blender/python/simple_enum_gen.py

===================================================================

diff --git a/build_files/package_spec/build_archive.py b/build_files/package_spec/build_archive.py
index bd00984c74b..5ca2f319d87 100755
--- a/build_files/package_spec/build_archive.py
+++ b/build_files/package_spec/build_archive.py
@@ -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)
diff --git a/source/blender/python/simple_enum_gen.py b/source/blender/python/simple_enum_gen.py
index 3a9c1847fc7..861701f4b4c 100644
--- a/source/blender/python/simple_enum_gen.py
+++ b/source/blender/python/simple_enum_gen.py
@@ -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))



More information about the Bf-blender-cvs mailing list