Skip to content

Commit

Permalink
depgen.py/deplist.py: address IDE warnings and suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
skosukhin committed Apr 25, 2024
1 parent fe6e10b commit 0dca10a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mkhelper/depgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def module_start_callback(module):
def module_use_callback(module):
required_modules.add(module)

def submodule_start_callback(submodule, parent, module):
def submodule_start_callback(_submodule, _parent, module):
required_modules.add(module)

lc_debug_info = None
Expand Down
2 changes: 2 additions & 0 deletions mkhelper/depgen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
try:
from itertools import zip_longest as zip_longest23
except ImportError:
# noinspection PyUnresolvedReferences
from itertools import izip_longest as zip_longest23


def open23(name, mode="r"):
if sys.version_info < (3, 0, 0):
return open(name, mode)
else:
# noinspection PyArgumentList
return open(name, mode, encoding="latin-1")


Expand Down
3 changes: 2 additions & 1 deletion mkhelper/depgen/fortran_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


class FortranParser:
_re_include = re.compile(r'^\s*include\s+(\'|")(.*?)\1', re.I)
_re_include = re.compile(r'^\s*include\s+([\'"])(.*?)\1', re.I)
_re_line_continue_start = re.compile(r"^(.*)&\s*$")
_re_line_continue_end = re.compile(r"^\s*&")
_re_module_start = re.compile(
Expand Down Expand Up @@ -212,6 +212,7 @@ def parse(self, stream, stream_name):

# return an empty iterator
return
# noinspection PyUnreachableCode
yield

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion mkhelper/depgen/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,5 @@ def eval_expression(self, expr):
try:
result = bool(eval(expr, {}))
return 1 if result else -1
except:
except Exception:
return 0
2 changes: 1 addition & 1 deletion mkhelper/deplist.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def check_cycles_skip_visit_cb(vertex):
args.check_colour,
)

def check_cycles_finish_visit_cb(vertex):
def check_cycles_finish_visit_cb(_):
path.pop()

start_visit_cb_list.append(check_cycles_start_visit_cb)
Expand Down

0 comments on commit 0dca10a

Please sign in to comment.