diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-03-29 21:42:11 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-03-29 21:42:11 +0200 |
| commit | e95acfe671c6c40ffdc92f466008dce3fce723a6 (patch) | |
| tree | 9d733b93ca596e5130d21af7f28dd62d553a9b10 /utils | |
| parent | 48b32fb4b820d92ca92b454a00131fb64ff6f883 (diff) | |
| download | python-apt-e95acfe671c6c40ffdc92f466008dce3fce723a6.tar.gz | |
do not require files to end in .py if they are passed on the command
line or if they contain python somewhere in the shebang line.
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/migrate-0.8.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/migrate-0.8.py b/utils/migrate-0.8.py index 49596fc4..9f7790f7 100755 --- a/utils/migrate-0.8.py +++ b/utils/migrate-0.8.py @@ -193,7 +193,10 @@ def find_deprecated_py(): def find_occurences(all_old, files): """Find all ocurrences in the given Python files.""" for fname in files: - if fname.endswith('setup3.py') or not fname.endswith('.py'): + if not os.path.exists(fname): + continue + if not (fname in sys.argv or fname.endswith('.py') or + re.match('^#.*python.*', open(fname).readline())): continue words = defaultdict(lambda: set()) |
