这段代码块(来自PEP 3109)的向后(尽可能是2.6)兼容语法是什么:
try:
self.spawn(pp_args)
except DistutilsExecError as msg:
raise CompileError from msg
这段代码块(来自PEP 3109)的向后(尽可能是2.6)兼容语法是什么:
try:
self.spawn(pp_args)
except DistutilsExecError as msg:
raise CompileError from msg
这是在Python 2.x中最接近的写法:
try:
self.spawn(pp_args)
except DistutilsExecError as msg:
print "DistutilsExecError : " + str(DistutilsExecError(msg))
print
print "The above exception was the direct cause of the following exception:"
raise CompileError