Message146953
Getting the general case right seems a bit too difficult. Examples like
[execfile(n) for n in names if condition(n)]
execfile(execfile(n1) or n2)
try: 1 / 0
except execfile(n) or ZeroDivisionError: pass
would require rather complex transformations to get exactly matching behaviour, and obviously we don't want to explode the fixer code to support such nonsense.
I think it is enough to cover the case of an execfile() call that forms a statement of its own. Browsing through the first ten pages of a Google code search for "execfile" didn't reveal any other uses, except for a few that aren't covered by the current version of the fixer either. [1]
I'd suggest to simply throw a "could not convert" warning for any other uses of execfile(). Opinions?
[1]: http://www.google.com/codesearch#yqvQ9RM69FY/mercurial/lsprof.py&q=execfile&sq=&l=111&ct=rc&cd=49 |
|
Date |
User |
Action |
Args |
2011-11-03 17:34:48 | smarnach | set | recipients:
+ smarnach, pitrou, benjamin.peterson, petri.lehtinen |
2011-11-03 17:34:48 | smarnach | set | messageid: <1320341688.19.0.908675994058.issue13332@psf.upfronthosting.co.za> |
2011-11-03 17:34:47 | smarnach | link | issue13332 messages |
2011-11-03 17:34:47 | smarnach | create | |
|