Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a8919e

Browse files
Rephrase the comments and simplified the logic
1 parent 1ec6724 commit 9a8919e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/pdb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ def check(self):
142142
print('Error:', self.orig, 'is a directory')
143143
sys.exit(1)
144144

145-
# Replace pdb's dir with script's dir in front of module search path
146-
# if safe_path is not set, otherwise sys.path[0] is not pdb's dir
147-
if not getattr(sys.flags, 'safe_path', None):
145+
# If safe_path(-P) is not set, sys.path[0] would be the directory
146+
# of pdb, and we should replace it with the directory of the script
147+
if not sys.flags.safe_path:
148148
sys.path[0] = os.path.dirname(self)
149149

150150
@property

0 commit comments

Comments
 (0)