Skip to content

Conversation

@gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Apr 17, 2024

"sys" is a makeup filename in

    except ValueError:
        globals = sys.__dict__
        filename = "sys"
        lineno = 1

so we should never try to get the source code for it. Otherwise if there happens to be a sys file in sys.path, the first line will be displayed.

This is a backward compatible patch for backport only. We will have some new solution for main

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@JelleZijlstra JelleZijlstra enabled auto-merge (squash) April 19, 2024 03:52
@JelleZijlstra JelleZijlstra merged commit bbb1a8e into python:3.12 Apr 19, 2024
@gaogaotiantian gaogaotiantian deleted the fix-sys-warning-3.12 branch April 19, 2024 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants