Skip to content

Commit ff7547f

Browse files
committed
Fix test_cmd_line_script
1 parent 7bfde50 commit ff7547f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_cmd_line_script.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def f():
5151
print('__main__ was located through the import system')
5252
assertIdentical(__spec__.loader, __loader__)
5353
expected_spec_name = os.path.splitext(os.path.basename(__file__))[0]
54+
if __spec__.parent and __spec__.parent != __spec__.name:
55+
expected_spec_name = __spec__.parent + '.' + expected_spec_name
5456
assertEqual(__spec__.name, expected_spec_name)
5557
assertIdentical(__spec__.submodule_search_locations, None)
5658
assertEqual(__spec__.origin, __file__)

0 commit comments

Comments
 (0)