summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-03-29 17:15:33 +0200
committerJulian Andres Klode <jak@debian.org>2010-03-29 17:15:33 +0200
commit72c3745b28d64d43f6c21f960e13f0ee6142ec8d (patch)
tree3f8b7901985c8b9e5785afb0fa6dbae397a33708
parent33851a84b6868eaff1fadaa5b5f57aa696cdc2e8 (diff)
downloadpython-apt-72c3745b28d64d43f6c21f960e13f0ee6142ec8d.tar.gz
utils/migrate-0.8.py: Open files in universal newline support and pass filename to ast.parse.
-rw-r--r--debian/changelog2
-rwxr-xr-xutils/migrate-0.8.py2
2 files changed, 3 insertions, 1 deletions
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: