Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ python -m atcoder [your-source-code] -o [single-combined-code]

### For all users

+ Python 3.8.2
+ Python 3.7.0+, 3.8.0+
+ pip

### For developer
Expand Down
2 changes: 1 addition & 1 deletion README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ python -m atcoder [your-source-code] -o [single-combined-code]

### 利用者、開発者向け情報

+ Python 3.8.2
+ Python 3.7.0+, 3.8.0+
+ pip

### 開発者向け情報
Expand Down
12 changes: 10 additions & 2 deletions atcoder/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ def iter_child_nodes(
if isinstance(node, ast.Import):
for name in node.names:
if re.match(r'^atcoder\.?', name.name):
import_info = ImportInfo(node.lineno, node.end_lineno)
if hasattr(node, 'end_lineno'):
end_lineno = node.end_lineno
else:
end_lineno = node.lineno
import_info = ImportInfo(node.lineno, end_lineno)
elif isinstance(node, ast.ImportFrom):
if re.match(r'^atcoder\.?', node.module):
import_info = ImportInfo(node.lineno, node.end_lineno, node.module)
if hasattr(node, 'end_lineno'):
end_lineno = node.end_lineno
else:
end_lineno = node.lineno
import_info = ImportInfo(node.lineno, end_lineno, node.module)

for child in ast.iter_child_nodes(node):
result += iter_child_nodes(child, import_info)
Expand Down