diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed6e1de..23bda6e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/doc/protocol_build.py b/doc/protocol_build.py index 77fe78a..aaad64b 100644 --- a/doc/protocol_build.py +++ b/doc/protocol_build.py @@ -14,7 +14,7 @@ ) ) - + def _is_within_directory(directory, target): """Helper to check for CVE-2007-4559""" abs_directory = os.path.abspath(directory) @@ -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): @@ -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)