mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-11-20 17:40:06 +03:00
Fix Python formatting (Black) (#453)
This commit is contained in:
parent
e333208cb9
commit
becb6e2cda
@ -139,7 +139,6 @@ class TranslateLocallyLike(Repository):
|
|||||||
with tarfile.open(save_location) as model_archive:
|
with tarfile.open(save_location) as model_archive:
|
||||||
|
|
||||||
def is_within_directory(directory, target):
|
def is_within_directory(directory, target):
|
||||||
|
|
||||||
abs_directory = os.path.abspath(directory)
|
abs_directory = os.path.abspath(directory)
|
||||||
abs_target = os.path.abspath(target)
|
abs_target = os.path.abspath(target)
|
||||||
|
|
||||||
@ -148,7 +147,6 @@ class TranslateLocallyLike(Repository):
|
|||||||
return prefix == abs_directory
|
return prefix == abs_directory
|
||||||
|
|
||||||
def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
|
def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
|
||||||
|
|
||||||
for member in tar.getmembers():
|
for member in tar.getmembers():
|
||||||
member_path = os.path.join(path, member.name)
|
member_path = os.path.join(path, member.name)
|
||||||
if not is_within_directory(path, member_path):
|
if not is_within_directory(path, member_path):
|
||||||
|
2
setup.py
2
setup.py
@ -16,6 +16,7 @@ PLAT_TO_CMAKE = {
|
|||||||
"win-arm64": "ARM64",
|
"win-arm64": "ARM64",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# A CMakeExtension needs a sourcedir instead of a file list.
|
# A CMakeExtension needs a sourcedir instead of a file list.
|
||||||
# The name must be the _single_ output extension from the CMake build.
|
# The name must be the _single_ output extension from the CMake build.
|
||||||
# If you need multiple extensions, see scikit-build.
|
# If you need multiple extensions, see scikit-build.
|
||||||
@ -84,7 +85,6 @@ class CMakeBuild(build_ext):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
# Single config generators are handled "normally"
|
# Single config generators are handled "normally"
|
||||||
single_config = any(x in cmake_generator for x in {"NMake", "Ninja"})
|
single_config = any(x in cmake_generator for x in {"NMake", "Ninja"})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user