delattr() can raise AttributeError, not KeyError.
Use keyword arg to set verbose flag in test func.
This commit is contained in:
parent
422869a75c
commit
63f0cf0840
@ -229,7 +229,7 @@ class RExec(ihooks._Verbose):
|
|||||||
for name in exceptions:
|
for name in exceptions:
|
||||||
try:
|
try:
|
||||||
delattr(dst, name)
|
delattr(dst, name)
|
||||||
except KeyError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
return dst
|
return dst
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ class RExec(ihooks._Verbose):
|
|||||||
|
|
||||||
def test():
|
def test():
|
||||||
import traceback
|
import traceback
|
||||||
r = RExec(None, '-v' in sys.argv[1:])
|
r = RExec(verbose=('-v' in sys.argv[1:]))
|
||||||
print "*** RESTRICTED *** Python", sys.version
|
print "*** RESTRICTED *** Python", sys.version
|
||||||
print sys.copyright
|
print sys.copyright
|
||||||
while 1:
|
while 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user