Mercurial > babel > old > mirror
changeset 330:9809b94b7d88
Reinstate changeset r362, but this time properly wrap the exception list in
braces.
Submitted by: cboos
author | jruigrok |
---|---|
date | Fri, 02 May 2008 22:13:17 +0000 |
parents | 01d84ef3cb3b |
children | 852cd3703113 |
files | babel/util.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/babel/util.py +++ b/babel/util.py @@ -16,7 +16,6 @@ import codecs from datetime import timedelta, tzinfo import os -import parser import re try: set @@ -75,8 +74,9 @@ m = PYTHON_MAGIC_COMMENT_re.match(line1) if not m: try: + import parser parser.suite(line1) - except SyntaxError: + except (ImportError, SyntaxError): # Either it's a real syntax error, in which case the source is # not valid python source, or line2 is a continuation of line1, # in which case we don't want to scan line2 for a magic