Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sys.stdlib_module_names #198

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion flake8_import_order/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import ast
import sys
from collections import namedtuple
from enum import IntEnum

from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__,
)
from .stdlib_list import STDLIB_NAMES
if sys.version_info >= (3, 10):
STDLIB_NAMES = sys.stdlib_module_names | {"__main__", "test"}
else:
from .stdlib_list import STDLIB_NAMES

__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
Expand Down
1 change: 0 additions & 1 deletion tests/test_cases/complete_appnexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from functools import *
import os
from os import path
import StringIO
Copy link
Contributor Author

@Dreamsorcerer Dreamsorcerer Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no stdlib modules in Py3 that start with an uppercase character, so I think this just has to be removed from the tests.

import sys

import X
Expand Down
1 change: 0 additions & 1 deletion tests/test_cases/complete_edited.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ast
import os
import StringIO
import sys
from functools import *
from os import path
Expand Down
1 change: 0 additions & 1 deletion tests/test_cases/complete_google.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from functools import *
import os
from os import path
import StringIO
import sys

import localpackage
Expand Down
1 change: 0 additions & 1 deletion tests/test_cases/complete_pycharm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# pycharm

import StringIO
import ast
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion tests/test_cases/complete_smarkets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ast
import os
import StringIO
import sys
from functools import *
from os import path
Expand Down