From 72c3745b28d64d43f6c21f960e13f0ee6142ec8d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 29 Mar 2010 17:15:33 +0200 Subject: utils/migrate-0.8.py: Open files in universal newline support and pass filename to ast.parse. --- debian/changelog | 2 ++ utils/migrate-0.8.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 69eecc2b..a8211c5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low - Map ArchiveURI property to archive_uri * debian/control: - Change priority to standard, keep -doc and -dev on optional. + * utils/migrate-0.8.py: + - Open files in universal newline support and pass filename to ast.parse. [ Michael Vogt ] * apt/cache.py: diff --git a/utils/migrate-0.8.py b/utils/migrate-0.8.py index d0d8e9a1..56d51ef9 100755 --- a/utils/migrate-0.8.py +++ b/utils/migrate-0.8.py @@ -197,7 +197,7 @@ def find_occurences(all_old, files): continue words = defaultdict(lambda: set()) - for i in ast.walk(ast.parse(open(fname).read())): + for i in ast.walk(ast.parse(open(fname, "rU").read(), fname)): if isinstance(i, _ast.ImportFrom): for alias in i.names: if alias.name in all_old: -- cgit v1.2.3