def reraise_unmasked_exceptions(unmasked=()):
# There are a few catch-all except: statements in this module, for
# catching input that's bad in unexpected ways.
# This function re-raises some exceptions we don't want to trap.
import mechanize, warnings
if not mechanize.USE_BARE_EXCEPT:
raise
unmasked = unmasked + (KeyboardInterrupt, SystemExit, MemoryError)
etype = sys.exc_info()[0]
if issubclass(etype, unmasked):
raise
# swallowed an exception
import traceback, StringIO
f = StringIO.StringIO()
traceback.print_exc(None, f)
msg = f.getvalue()
warnings.warn("mechanize bug!\n%s" % msg, stacklevel=2)
_clientcookie.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录