Skip to content

Commit

Permalink
Update black pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
flacjacket committed Dec 20, 2022
1 parent 88de992 commit c04a68b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.12.0
hooks:
- id: black
# Use the latest supported version here
Expand Down
6 changes: 3 additions & 3 deletions doc/protocol_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)
)


def _is_within_directory(directory, target):
"""Helper to check for CVE-2007-4559"""
abs_directory = os.path.abspath(directory)
Expand All @@ -32,7 +32,7 @@ def _safe_extractall(tar, path=".", members=None, *, numeric_owner=False):
if not is_within_directory(path, member_path):
raise Exception("Attempted Path Traversal in Tar File")

tar.extractall(path, members, numeric_owner=numeric_owner)
tar.extractall(path, members, numeric_owner=numeric_owner)


def protocols_build(output_dir):
Expand All @@ -45,7 +45,7 @@ def protocols_build(output_dir):
# download the protocols file and extract it
protocol_dest = "wayland-protocols-{}".format(protocols_version)
urllib.request.urlretrieve(protocols_source, protocol_dest + ".tar.xz")

with tarfile.open(protocol_dest + ".tar.xz") as f:
_safe_extractall(f)

Expand Down

0 comments on commit c04a68b

Please sign in to comment.