mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 08:17:13 +03:00
Fixed printed file line number sometimes off by one
This commit is contained in:
parent
e89c0e9e21
commit
cba7aee874
@ -84,7 +84,7 @@ def extract_comments(call: ast.Call, lines: list[str], file: pathlib.Path) -> Op
|
||||
|
||||
comment = match.group(1).strip()
|
||||
if not comment.startswith('# LANG:'):
|
||||
bad_comment = f'Unknown comment for {file}:{current} {line}'
|
||||
bad_comment = f'Unknown comment for {file}:{call.lineno} {line}'
|
||||
continue
|
||||
|
||||
out = comment.replace('# LANG:', '').strip()
|
||||
@ -95,7 +95,7 @@ def extract_comments(call: ast.Call, lines: list[str], file: pathlib.Path) -> Op
|
||||
print(bad_comment, file=sys.stderr)
|
||||
|
||||
if out is None:
|
||||
print(f'No comment for {file}:{current} {line}', file=sys.stderr)
|
||||
print(f'No comment for {file}:{call.lineno} {line}', file=sys.stderr)
|
||||
|
||||
return out
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user