Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-17393: do not convert import of non-package#16826

Closed
romuald wants to merge 1 commit into
python:mainpython/cpython:mainfrom
romuald:lib2to3-fix-non-package-importromuald/cpython:lib2to3-fix-non-package-importCopy head branch name to clipboard
Closed

bpo-17393: do not convert import of non-package#16826
romuald wants to merge 1 commit into
python:mainpython/cpython:mainfrom
romuald:lib2to3-fix-non-package-importromuald/cpython:lib2to3-fix-non-package-importCopy head branch name to clipboard

Conversation

@romuald

@romuald romuald commented Oct 16, 2019

Copy link
Copy Markdown
Contributor

In lib2to3, when a patched code is importing a module that has the same
name as a local directory, check that it contains an __init__.py file
before converting it to a local import

Quick example:

fixtures/__init__.py
fixtures/json/things.json

Previously import json was converted to from . import json

https://bugs.python.org/issue17393

In lib2to3, when a patched code is importing a module that has the same
name as a local directory, check that it contains an __init__.py file
before converting it to a local import

Quick example:

```
fixtures/__init__.py
fixtures/json/things.json
```

Previously `import json` was converted to `from . import json`
@encukou

encukou commented Feb 18, 2020

Copy link
Copy Markdown
Member

I don't feel comfortable reviewing changes here. The other suggested reviewers might also not know too much about lib2to3; they were autoselected by the import keyword.
Adding Benjamin as the lib2to3 expert.

@iritkatriel

iritkatriel commented Oct 20, 2021

Copy link
Copy Markdown
Member

Closed under bpo-45544.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.