Use "Exception as _" instead of "Exception, _"
Requires Python 2.6+
This commit is contained in:
+2
-2
@@ -177,7 +177,7 @@ class CLI( Cmd ):
|
|||||||
output( result + '\n' )
|
output( result + '\n' )
|
||||||
else:
|
else:
|
||||||
output( repr( result ) + '\n' )
|
output( repr( result ) + '\n' )
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
output( str( e ) + '\n' )
|
output( str( e ) + '\n' )
|
||||||
|
|
||||||
# We are in fact using the exec() pseudo-function
|
# 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')"""
|
Node names may be used, e.g.: px print h1.cmd('ls')"""
|
||||||
try:
|
try:
|
||||||
exec( line, globals(), self.getLocals() )
|
exec( line, globals(), self.getLocals() )
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
output( str( e ) + '\n' )
|
output( str( e ) + '\n' )
|
||||||
|
|
||||||
# pylint: enable=broad-except,exec-used
|
# pylint: enable=broad-except,exec-used
|
||||||
|
|||||||
Reference in New Issue
Block a user