@@ -415,16 +415,15 @@ def test_realpath_symlink_loops_strict(self):
415
415
self .assertRaises (OSError , ntpath .realpath , ABSTFN + "1" , strict = True )
416
416
self .assertRaises (OSError , ntpath .realpath , ABSTFN + "2" , strict = True )
417
417
self .assertRaises (OSError , ntpath .realpath , ABSTFN + "1\\ x" , strict = True )
418
- self .assertRaises (OSError , ntpath .realpath , ABSTFN + "1\\ ..\\ x" , strict = True )
419
418
# Windows eliminates '..' components before resolving links, so the
420
- # following 2 realpath() calls are not expected to raise.
419
+ # following call is not expected to raise.
421
420
self .assertPathEqual (ntpath .realpath (ABSTFN + "1\\ .." , strict = True ),
422
421
ntpath .dirname (ABSTFN ))
422
+ self .assertRaises (OSError , ntpath .realpath , ABSTFN + "1\\ ..\\ x" , strict = True )
423
423
os .symlink (ABSTFN + "x" , ABSTFN + "y" )
424
- self .assertPathEqual ( ntpath .realpath ( ABSTFN + "1\\ ..\\ "
424
+ self .assertRaises ( OSError , ntpath .realpath , ABSTFN + "1\\ ..\\ "
425
425
+ ntpath .basename (ABSTFN ) + "y" ,
426
- strict = True ),
427
- ABSTFN + "x" )
426
+ strict = True )
428
427
self .assertRaises (OSError , ntpath .realpath ,
429
428
ABSTFN + "1\\ ..\\ " + ntpath .basename (ABSTFN ) + "1" ,
430
429
strict = True )
0 commit comments