Skip to content

Commit ab1b6c1

Browse files
committed
use os/sys
1 parent 66c147d commit ab1b6c1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Lib/test/test_compile.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -795,24 +795,24 @@ def or_false(x):
795795
def test_imported_load_method(self):
796796
sources = [
797797
"""\
798-
import ast
798+
import os
799799
def foo():
800-
return ast.Name('abydos')
800+
return os.uname()
801801
""",
802802
"""\
803-
import ast as python_ast
803+
import os as operating_system
804804
def foo():
805-
return python_ast.Name('chulak')
805+
return operating_system.uname()
806806
""",
807807
"""\
808-
from concurrent import futures
809-
def foo():
810-
return futures.Executor()
808+
from os import path
809+
def foo(x):
810+
return path.join(x)
811811
""",
812812
"""\
813-
from concurrent import futures as c_futures
814-
def foo():
815-
return c_futures.Executor()
813+
from os import path as os_path
814+
def foo(x):
815+
return os_path.join(x)
816816
"""
817817
]
818818
for source in sources:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Directly imported objects and modules (through import and from import
22
statements) don't generate ``LOAD_METHOD``/``CALL_METHOD`` for directly
33
accessed objects on their namespace. They now use the regular
4-
``LOAD_ATTR``/``CALL_FUNC``.
4+
``LOAD_ATTR``/``CALL_FUNCTION``.

0 commit comments

Comments
 (0)