@@ -927,15 +927,15 @@ def test_missing_source_legacy(self):
927
927
m = __import__ (TESTFN )
928
928
try :
929
929
self .assertEqual (m .__file__ ,
930
- os .path .join (os .getcwd (), os .curdir , os . path .relpath (pyc_file )))
930
+ os .path .join (os .getcwd (), os .path .relpath (pyc_file )))
931
931
finally :
932
932
os .remove (pyc_file )
933
933
934
934
def test___cached__ (self ):
935
935
# Modules now also have an __cached__ that points to the pyc file.
936
936
m = __import__ (TESTFN )
937
937
pyc_file = importlib .util .cache_from_source (TESTFN + '.py' )
938
- self .assertEqual (m .__cached__ , os .path .join (os .getcwd (), os . curdir , pyc_file ))
938
+ self .assertEqual (m .__cached__ , os .path .join (os .getcwd (), pyc_file ))
939
939
940
940
@skip_if_dont_write_bytecode
941
941
def test___cached___legacy_pyc (self ):
@@ -951,7 +951,7 @@ def test___cached___legacy_pyc(self):
951
951
importlib .invalidate_caches ()
952
952
m = __import__ (TESTFN )
953
953
self .assertEqual (m .__cached__ ,
954
- os .path .join (os .getcwd (), os .curdir , os . path .relpath (pyc_file )))
954
+ os .path .join (os .getcwd (), os .path .relpath (pyc_file )))
955
955
956
956
@skip_if_dont_write_bytecode
957
957
def test_package___cached__ (self ):
@@ -971,10 +971,10 @@ def cleanup():
971
971
m = __import__ ('pep3147.foo' )
972
972
init_pyc = importlib .util .cache_from_source (
973
973
os .path .join ('pep3147' , '__init__.py' ))
974
- self .assertEqual (m .__cached__ , os .path .join (os .getcwd (), os . curdir , init_pyc ))
974
+ self .assertEqual (m .__cached__ , os .path .join (os .getcwd (), init_pyc ))
975
975
foo_pyc = importlib .util .cache_from_source (os .path .join ('pep3147' , 'foo.py' ))
976
976
self .assertEqual (sys .modules ['pep3147.foo' ].__cached__ ,
977
- os .path .join (os .getcwd (), os . curdir , foo_pyc ))
977
+ os .path .join (os .getcwd (), foo_pyc ))
978
978
979
979
def test_package___cached___from_pyc (self ):
980
980
# Like test___cached__ but ensuring __cached__ when imported from a
@@ -998,10 +998,10 @@ def cleanup():
998
998
m = __import__ ('pep3147.foo' )
999
999
init_pyc = importlib .util .cache_from_source (
1000
1000
os .path .join ('pep3147' , '__init__.py' ))
1001
- self .assertEqual (m .__cached__ , os .path .join (os .getcwd (), os . curdir , init_pyc ))
1001
+ self .assertEqual (m .__cached__ , os .path .join (os .getcwd (), init_pyc ))
1002
1002
foo_pyc = importlib .util .cache_from_source (os .path .join ('pep3147' , 'foo.py' ))
1003
1003
self .assertEqual (sys .modules ['pep3147.foo' ].__cached__ ,
1004
- os .path .join (os .getcwd (), os . curdir , foo_pyc ))
1004
+ os .path .join (os .getcwd (), foo_pyc ))
1005
1005
1006
1006
def test_recompute_pyc_same_second (self ):
1007
1007
# Even when the source file doesn't change timestamp, a change in
0 commit comments