summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2015-09-09 22:18:24 +0200
committerPeter Odding <peter@peterodding.com>2015-09-09 22:18:24 +0200
commita7c8266fe784dffa2a5fdd1526437c6ba7ba1aab (patch)
treee7259d37862fcd1c9f925475d32f29247cc84587
parent6c5df3650a90ca2567e6f865de237c5fb1fadf5d (diff)
Restore Python 2.6 compatibility for `python setup.py {s,b}dist'
-rw-r--r--setup_helper.py7
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()