Use "Exception as _" instead of "Exception, _"

Requires Python 2.6+
This commit is contained in:
Brad Walker
2016-06-21 16:27:04 -07:00
committed by Bob Lantz
parent fb1f0dca2a
commit dd8adda3ff
+2 -2
View File
@@ -177,7 +177,7 @@ class CLI( Cmd ):
output( result + '\n' )
else:
output( repr( result ) + '\n' )
except Exception, e:
except Exception as e:
output( str( e ) + '\n' )
# We are in fact using the exec() pseudo-function
@@ -188,7 +188,7 @@ class CLI( Cmd ):
Node names may be used, e.g.: px print h1.cmd('ls')"""
try:
exec( line, globals(), self.getLocals() )
except Exception, e:
except Exception as e:
output( str( e ) + '\n' )
# pylint: enable=broad-except,exec-used