- Notifications
You must be signed in to change notification settings - Fork1.5k
Detect the program name whenpython -m was executed#424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| Display(output,out=sys.stdout) | ||
| def_GetProgName(name,main=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In the current PR I don't think the main arg is passed anywhere (other than the test). Is a file missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It is only passed during testing.
dbieber commentedDec 20, 2022
Good idea! Thanks for submitting 👍 |
| Args: | ||
| name: Optional. The name of the command as entered at the command line. | ||
| main: Optional. This should only be passed during testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
See here :)
dbieber commentedSep 20, 2024
The new behavior doesn't look quite like what we want: Instead, we'd prefer the following, right? |
dukecat0 commentedSep 29, 2025
It looks like the quotes come from here: Line 190 in91febb4
I think the reason is that there are spaces inside self.name, i.e./usr/bin/python -m sample. Any opinions on how should we deal with this case? |
Uh oh!
There was an error while loading.Please reload this page.
Closes#76
Old behaviour:
New behaviour: