# HG changeset patch # User jruigrok # Date 1209766397 0 # Node ID 9809b94b7d88cc631cb6091c38fa1a6a0fe8ea84 # Parent 01d84ef3cb3b33dda0cb3c1d530315fa0295e1e5 Reinstate changeset r362, but this time properly wrap the exception list in braces. Submitted by: cboos diff --git a/babel/util.py b/babel/util.py --- 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