From 754b55a4b7ab14f98aa0ec308d176a0265885d03 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Thu, 15 Jul 2021 21:08:28 -0700 Subject: [PATCH] Fixed #1785: module incorrectly excluded from stdlib definition. --- CHANGELOG.md | 1 + isort/stdlibs/py27.py | 1 + isort/stdlibs/py35.py | 1 + isort/stdlibs/py36.py | 1 + isort/stdlibs/py37.py | 1 + isort/stdlibs/py38.py | 1 + isort/stdlibs/py39.py | 1 + scripts/mkstdlibs.py | 2 +- 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f1c16aec..fe69ecc22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/ - Improved text of skipped file message to mention gitignore feature. - Fixed #1779: Pylama integration ignores pylama specific isort config overrides. - Fixed #1781: `--from-first` CLI flag shouldn't take any arguments. + - Fixed #1785: `_ast` module incorrectly excluded from stdlib definition. ### 5.9.2 July 8th 2021 - Improved behavior of `isort --check --atomic` against Cython files. diff --git a/isort/stdlibs/py27.py b/isort/stdlibs/py27.py index 87aa67f1f..a9bc99d0c 100644 --- a/isort/stdlibs/py27.py +++ b/isort/stdlibs/py27.py @@ -40,6 +40,7 @@ "UserString", "W", "__builtin__", + "_ast", "_winreg", "abc", "aepack", diff --git a/isort/stdlibs/py35.py b/isort/stdlibs/py35.py index 274d8a7d1..29ab9aeba 100644 --- a/isort/stdlibs/py35.py +++ b/isort/stdlibs/py35.py @@ -6,6 +6,7 @@ """ stdlib = { + "_ast", "_dummy_thread", "_thread", "abc", diff --git a/isort/stdlibs/py36.py b/isort/stdlibs/py36.py index 8ae02a150..59ebd24cb 100644 --- a/isort/stdlibs/py36.py +++ b/isort/stdlibs/py36.py @@ -6,6 +6,7 @@ """ stdlib = { + "_ast", "_dummy_thread", "_thread", "abc", diff --git a/isort/stdlibs/py37.py b/isort/stdlibs/py37.py index 0eb1dd6fa..e0ad1228a 100644 --- a/isort/stdlibs/py37.py +++ b/isort/stdlibs/py37.py @@ -6,6 +6,7 @@ """ stdlib = { + "_ast", "_dummy_thread", "_thread", "abc", diff --git a/isort/stdlibs/py38.py b/isort/stdlibs/py38.py index 9bcea9a16..3d89fd26b 100644 --- a/isort/stdlibs/py38.py +++ b/isort/stdlibs/py38.py @@ -6,6 +6,7 @@ """ stdlib = { + "_ast", "_dummy_thread", "_thread", "abc", diff --git a/isort/stdlibs/py39.py b/isort/stdlibs/py39.py index 7bcb8f2b7..4b7dd5954 100644 --- a/isort/stdlibs/py39.py +++ b/isort/stdlibs/py39.py @@ -6,6 +6,7 @@ """ stdlib = { + "_ast", "_thread", "abc", "aifc", diff --git a/scripts/mkstdlibs.py b/scripts/mkstdlibs.py index ee08ba1d0..cf5237987 100755 --- a/scripts/mkstdlibs.py +++ b/scripts/mkstdlibs.py @@ -31,7 +31,7 @@ class FakeApp: invdata = fetch_inventory(FakeApp(), "", url) # Any modules we want to enforce across Python versions stdlib can be included in set init - modules = {"posixpath", "ntpath", "sre_constants", "sre_parse", "sre_compile", "sre"} + modules = {"_ast", "posixpath", "ntpath", "sre_constants", "sre_parse", "sre_compile", "sre"} for module in invdata["py:module"]: root, *_ = module.split(".") if root not in ["__future__", "__main__"]: