Skip to content

Commit 6cc4da2

Browse files
committed
Fix pylint warnings
1 parent d0074ce commit 6cc4da2

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
raise RuntimeError("The build scripts are no longer compatible with Python 2")
4848

4949
import tempfile
50-
import urllib.request as urllib_request
5150
from argparse import ArgumentParser
5251
from dataclasses import dataclass
5352
import stat

mx.graalpython/verify_patches.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
import sys
4242
from pathlib import Path
4343

44-
from pip._vendor import tomli
45-
from pip._vendor.packaging.specifiers import SpecifierSet
44+
from pip._vendor import tomli # pylint: disable=no-name-in-module
45+
from pip._vendor.packaging.specifiers import SpecifierSet # pylint: disable=no-name-in-module
4646

4747
# Approved license identifiers in SPDX "short identifier" format
4848
ALLOWED_LICENSES = {
@@ -75,10 +75,10 @@ def validate_metadata(package_dir, metadata):
7575
patch_path = package_dir / patch
7676
assert patch_path.is_file(), f"Patch file does not exists: {patch_path}"
7777
patches.add(patch_path)
78-
license = rule.get('license')
79-
assert license, f"'license' not specified for patch {patch}"
80-
license = re.sub(r'[()]', ' ', license)
81-
for part in re.split(f'AND|OR', license):
78+
license_id = rule.get('license')
79+
assert license_id, f"'license' not specified for patch {patch}"
80+
license_id = re.sub(r'[()]', ' ', license_id)
81+
for part in re.split(f'AND|OR', license_id):
8282
part = part.strip()
8383
if ' WITH ' in part:
8484
part, exception = re.split(r'\s+WITH\s+', part, 1)
@@ -121,7 +121,7 @@ def main():
121121
validate_metadata(package_dir, metadata)
122122
else:
123123
assert False, f"Patch directory without metadata: {package_dir}"
124-
except Exception as e:
124+
except AssertionError as e:
125125
errors.append(f"\t{package_dir.name}: {e}")
126126
if errors:
127127
sys.exit("Patch metadata validation failed:\n" + '\n'.join(errors))

0 commit comments

Comments
 (0)