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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rephrase the comments and simplified the logic
  • Loading branch information
gaogaotiantian committed Nov 6, 2023
commit 9a8919eed3012f7e9d73846c6e530e065dad6b9d
6 changes: 3 additions & 3 deletions Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ def check(self):
print('Error:', self.orig, 'is a directory')
sys.exit(1)

# Replace pdb's dir with script's dir in front of module search path
# if safe_path is not set, otherwise sys.path[0] is not pdb's dir
if not getattr(sys.flags, 'safe_path', None):
# If safe_path(-P) is not set, sys.path[0] would be the directory
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# If safe_path(-P) is not set, sys.path[0] would be the directory
# If safe_path (-P) is not selected, sys.path[0] would be the directory

Comment thread
gaogaotiantian marked this conversation as resolved.
Outdated
# of pdb, and we should replace it with the directory of the script
if not sys.flags.safe_path:
sys.path[0] = os.path.dirname(self)

@property
Expand Down