1 回答

TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超6個(gè)贊
2to3
或者modernize
應(yīng)該有幫助。這只是 Python 語法的問題。
2to3
隨 Python 一起提供,也可以作為 Python 模塊執(zhí)行:
python?-m?lib2to3?-w?SConstruct
這是建議的補(bǔ)丁2to3
,看起來很?。?/p>
RefactoringTool: Refactored SConstruct
--- SConstruct? (original)
+++ SConstruct? (refactored)
@@ -3,8 +3,8 @@
?env = Environment(ENV = os.environ)
?try:
? ? ?env.Tool('config', toolpath = [os.environ.get('CBANG_HOME')])
-except Exception, e:
-? ? raise Exception, 'CBANG_HOME not set?\n' + str(e)
+except Exception as e:
+? ? raise Exception('CBANG_HOME not set?\n' + str(e))
?
?env.CBLoadTools('packager run_distutils osx fah-client-version')
?env.CBAddVariables(
@@ -14,7 +14,7 @@
?# Version
?try:
? ? ?version = env.FAHClientVersion()
-except Exception, e:
+except Exception as e:
? ? ?print(e)
? ? ?version = '0.0.0'
? ? ?env.Replace(PACKAGE_VERSION = version)
RefactoringTool: Files that need to be modified:
RefactoringTool: SConstruct
添加回答
舉報(bào)