projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68d486c
)
main(): Slightly more informative error message when TokenError
author
Barry Warsaw
<barry@python.org>
Mon, 26 Feb 2001 04:46:53 +0000
(
04:46
+0000)
committer
Barry Warsaw
<barry@python.org>
Mon, 26 Feb 2001 04:46:53 +0000
(
04:46
+0000)
occurs. Also, continue processing.
Tools/i18n/pygettext.py
patch
|
blob
|
history
diff --git
a/Tools/i18n/pygettext.py
b/Tools/i18n/pygettext.py
index 834ba480e0c0164be8be3a6c1e2d27bc9d894b6e..a839799065034c6ebe040bdb673d5849978b1447 100755
(executable)
--- a/
Tools/i18n/pygettext.py
+++ b/
Tools/i18n/pygettext.py
@@
-464,7
+464,11
@@
def main():
closep = 1
try:
eater.set_filename(filename)
- tokenize.tokenize(fp.readline, eater)
+ try:
+ tokenize.tokenize(fp.readline, eater)
+ except tokenize.TokenError, e:
+ sys.stderr.write('%s: %s, line %d, column %d\n' %
+ (e[0], filename, e[1][0], e[1][1]))
finally:
if closep:
fp.close()