mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue