Skip to content

Commit

Permalink
Restore Python 2.6 compatibility for `python setup.py {s,b}dist'
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Sep 9, 2015
1 parent 6c5df36 commit a7c8266
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ def _set_uid_gid(tarinfo):
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()

Expand Down

0 comments on commit a7c8266

Please sign in to comment.