File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -183,15 +183,17 @@ class _ExecutableTarget:
183183
184184class _ScriptTarget (_ExecutableTarget ):
185185 def __init__ (self , target ):
186- self ._target = os .path .realpath (target )
187-
188- if not os .path .exists (self ._target ):
186+ if not os .path .exists (target ):
189187 print (f'Error: { target } does not exist' )
190188 sys .exit (1 )
191- if os .path .isdir (self . _target ):
189+ if os .path .isdir (target ):
192190 print (f'Error: { target } is a directory' )
193191 sys .exit (1 )
194192
193+ # Be careful with realpath to support pseudofilesystems (GH-142315).
194+ realpath = os .path .realpath (target )
195+ self ._target = realpath if os .path .exists (realpath ) else target
196+
195197 # If safe_path(-P) is not set, sys.path[0] is the directory
196198 # of pdb, and we should replace it with the directory of the script
197199 if not sys .flags .safe_path :
Original file line number Diff line number Diff line change 1+ Pdb can run scripts from pseudofiles. Patch by Bartosz Sławecki.
You can’t perform that action at this time.
0 commit comments