Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ def abs_paths():
continue # don't mess with a PEP 302-supplied __file__
try:
m.__file__ = os.path.abspath(m.__file__)
except (AttributeError, OSError):
except (AttributeError, OSError, TypeError):
pass
try:
m.__cached__ = os.path.abspath(m.__cached__)
except (AttributeError, OSError):
except (AttributeError, OSError, TypeError):

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.

Doesn't line-107 need catching TypeError too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

perhaps it should... However since file seems to be set in most cases it wont cause a TypeError.

pass


Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,7 @@ David Watson
Aaron Watters
Henrik Weber
Leon Weber
Steve Weber
Corran Webster
Glyn Webster
Phil Webster
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent site.main() exception if PYTHONSTARTUP is set. Patch by Steve Weber.