mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 18:07:37 +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()
|
comment = match.group(1).strip()
|
||||||
if not comment.startswith('# LANG:'):
|
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
|
continue
|
||||||
|
|
||||||
out = comment.replace('# LANG:', '').strip()
|
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)
|
print(bad_comment, file=sys.stderr)
|
||||||
|
|
||||||
if out is None:
|
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
|
return out
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user