Message209142
This will still cause issue in _sre.c; repr(sys.maxsize) == '9223372036854775807' != 'sys.maxsize'.
Yes, it's bad form to throw the net too wide, but for anything other than NameError, we fail out in the next block anyway. My (second) patch just makes for nicer output from the failure, though it does fail to say what the exception was.
What about something more along these lines?
bad = False
try:
eval(default)
except NameError:
pass # probably a named constant
except Exception as e:
fail("Malformed expression given as default value\n"
"{!r} raised {!r}".format(default, e)) |
|
Date |
User |
Action |
Args |
2014-01-25 04:12:53 | zach.ware | set | recipients:
+ zach.ware, larry |
2014-01-25 04:12:53 | zach.ware | set | messageid: <1390623173.26.0.698416437664.issue20381@psf.upfronthosting.co.za> |
2014-01-25 04:12:53 | zach.ware | link | issue20381 messages |
2014-01-25 04:12:52 | zach.ware | create | |
|