Skip to content

Simplify import AST in line with CPython.#1151

Merged
windelbouwman merged 1 commit intomasterfrom
import-syntax
Jul 15, 2019
Merged

Simplify import AST in line with CPython.#1151
windelbouwman merged 1 commit intomasterfrom
import-syntax

Conversation

@windelbouwman
Copy link
Copy Markdown
Contributor

@windelbouwman windelbouwman commented Jul 15, 2019

This does not yet account for the triple dot, but aligns the import AST nodes with cpython.

@windelbouwman windelbouwman requested a review from palaviv July 15, 2019 19:00
@windelbouwman windelbouwman merged commit 2e66a6a into master Jul 15, 2019
@coolreader18
Copy link
Copy Markdown
Member

coolreader18 commented Jul 19, 2019

I believe this change caused a regression in importing of the form from . import names. Attempting to import unittest panics at the module.name.unwrap() added in this change.

@windelbouwman
Copy link
Copy Markdown
Contributor Author

windelbouwman commented Jul 19, 2019

Yes, you are right, the relative import scheme without a module name does not work. I doubt if it worked before?

@coolreader18
Copy link
Copy Markdown
Member

Yeah, probably not. Changing unwrap() to unwrap_or_default() doesn't panic, but it still doesn't find the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants