Skip to content

Commit

Permalink
Fixing lint problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
drivanov committed Nov 7, 2024
1 parent a13a6b3 commit aed3d1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions python/dgl/data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def check_sha1(filename, sha1_hash):
return sha1.hexdigest() == sha1_hash


def extract_archive(file, target_dir, overwrite=True, filter='data'):
def extract_archive(file, target_dir, overwrite=True, filter="data"):
"""Extract archive file.
Parameters
Expand Down Expand Up @@ -282,7 +282,9 @@ def safe_extract(
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):
raise Exception("Attempted Path Traversal in Tar File")
tar.extractall(path, members, numeric_owner=numeric_owner, filter=filter)
tar.extractall(
path, members, numeric_owner=numeric_owner, filter=filter
)

safe_extract(archive, path=target_dir)
elif file.endswith(".gz"):
Expand Down
6 changes: 4 additions & 2 deletions python/dgl/graphbolt/internal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def check_sha1(filename, sha1_hash):
return sha1.hexdigest() == sha1_hash


def extract_archive(file, target_dir, overwrite=True, filter='data'):
def extract_archive(file, target_dir, overwrite=True, filter="data"):
"""Extract archive file.
Parameters
Expand Down Expand Up @@ -351,7 +351,9 @@ def safe_extract(
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):
raise Exception("Attempted Path Traversal in Tar File")
tar.extractall(path, members, numeric_owner=numeric_owner, filter=filter)
tar.extractall(
path, members, numeric_owner=numeric_owner, filter=filter
)

safe_extract(archive, path=target_dir)
elif file.endswith(".gz"):
Expand Down

0 comments on commit aed3d1d

Please sign in to comment.