Browse Source

Direct rewrites are unnecessary, constructor calls are enough

pull/262/head
Armin Ronacher 14 years ago
parent
commit
479e242afc
  1. 5
      scripts/flask-07-upgrade.py

5
scripts/flask-07-upgrade.py

@ -29,7 +29,6 @@ except ImportError:
_from_import_re = re.compile(r'^\s*from flask import\s+')
_direct_module_usage_re = re.compile(r'flask\.Module')
_string_re_part = r"('([^'\\]*(?:\\.[^'\\]*)*)'" \
r'|"([^"\\]*(?:\\.[^"\\]*)*)")'
_url_for_re = re.compile(r'\b(url_for\()(%s)' % _string_re_part)
@ -164,8 +163,8 @@ def rewrite_blueprint_imports(contents):
new_file.extend(rewrite_from_imports(match.group(),
line[match.end():],
lineiter))
continue
new_file.append(_direct_module_usage_re.sub('flask.Blueprint', line))
else:
new_file.append(line)
return ''.join(new_file)

Loading…
Cancel
Save