Skip to content

Commit 05a1448

Browse files
committed
auto-formatting
1 parent 67879ed commit 05a1448

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/compas/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,25 +303,25 @@ def get_bunny(localstorage=None):
303303
urlretrieve(url, destination)
304304

305305
with tarfile.open(destination) as file:
306+
306307
def is_within_directory(directory, target):
307-
308+
308309
abs_directory = os.path.abspath(directory)
309310
abs_target = os.path.abspath(target)
310-
311+
311312
prefix = os.path.commonprefix([abs_directory, abs_target])
312-
313+
313314
return prefix == abs_directory
314-
315+
315316
def safe_extract(tar, path=".", members=None, numeric_owner=False):
316-
317+
317318
for member in tar.getmembers():
318319
member_path = os.path.join(path, member.name)
319320
if not is_within_directory(path, member_path):
320321
raise Exception("Attempted Path Traversal in Tar File")
321-
322-
tar.extractall(path, members, numeric_owner=numeric_owner)
323-
324-
322+
323+
tar.extractall(path, members, numeric_owner=numeric_owner)
324+
325325
safe_extract(file, localstorage)
326326

327327
os.remove(destination)

0 commit comments

Comments
 (0)