diff options
author | Peter Odding <peter@peterodding.com> | 2015-09-09 22:18:24 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2015-09-09 22:18:24 +0200 |
commit | a7c8266fe784dffa2a5fdd1526437c6ba7ba1aab (patch) | |
tree | e7259d37862fcd1c9f925475d32f29247cc84587 /setup_helper.py | |
parent | 6c5df3650a90ca2567e6f865de237c5fb1fadf5d (diff) |
Restore Python 2.6 compatibility for `python setup.py {s,b}dist'
Diffstat (limited to 'setup_helper.py')
-rw-r--r-- | setup_helper.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/setup_helper.py b/setup_helper.py index 5d23137b..9e3834b3 100644 --- a/setup_helper.py +++ b/setup_helper.py @@ -124,7 +124,12 @@ def make_tarball(base_name, base_dir, compress='gzip', verbose=0, dry_run=0, tar = tarfile.open(archive_name, mode=mode) # This recursively adds everything underneath base_dir try: - tar.add(base_dir, filter=_set_uid_gid) + try: + # Support for the `filter' parameter was added in Python 2.7, + # earlier versions will raise TypeError. + tar.add(base_dir, filter=_set_uid_gid) + except TypeError: + tar.add(base_dir) finally: tar.close() |