Skip to content

Commit 9454112

Browse files
author
Shakeel Mohamed
committed
Replace tarfile.add() named arguments with positional arguments.
This change was made to maintain compatibility with Python 2.6 and Python 2.7, and follows the suggested fix in the docs: https://docs.python.org/2/library/tarfile.html#tarfile.TarFile.add In Python 2.6, the `exclude` named argument was added. In Python 2.7, the `filter` named argument was added, and `exclude` was deprecated.
1 parent 0e68701 commit 9454112

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def run(self):
168168
sdk_dir = os.path.abspath('.')
169169

170170
def exclude(path):
171-
# TODO: DVPL-5866 - Replace with filter function because exclude is deprecated
172171
basename = os.path.basename(path)
173172
for pattern in ['.DS_Store', '.idea', '*.log', '*.py[co]']:
174173
if fnmatch(basename, pattern):
@@ -189,7 +188,8 @@ def exclude(path):
189188

190189
with closing(tarfile.open(tarball, 'w')) as spl:
191190
for source, target in manifest:
192-
spl.add(source, arcname=target, exclude=exclude)
191+
# Args here are: name, arcname, recursive, and [exclude|filter]
192+
spl.add(source, target, True, exclude)
193193

194194
return
195195

0 commit comments

Comments
 (0)