-
Notifications
You must be signed in to change notification settings - Fork 124
pyscript fixes #888
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyscript fixes #888
Conversation
Fixed bug where cmd2 set sys.path[0] for a pyscript to its cwd instead of the script's directory.
Fixed bug where sys.path was not being restored after a pyscript ran.
Setting the following pyscript variables:
__name__: __main__
__file__: script path (as typed)
Removed do_py.run() function since it didn't handle arguments and offered no benefit over run_pyscript.
Codecov Report
@@ Coverage Diff @@
## master #888 +/- ##
==========================================
- Coverage 97.44% 97.44% -0.01%
==========================================
Files 14 14
Lines 3684 3680 -4
==========================================
- Hits 3590 3586 -4
Misses 94 94
Continue to review full report at Codecov.
|
| * Renamed set command's `-l/--long` flag to `-v/--verbose` for consistency with help and history commands. | ||
| * Setting the following pyscript variables: | ||
| * `__name__`: __main__ | ||
| * `__file__`: script path (as typed, ~ will be expanded) |
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.
Should the removal of do_py.run() be mentioned?
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.
Added to change log
cmd2.Cmd.py_localsdictionary.__name__: main__file__: script path (as typed, ~ will be expanded)do_py.run()function since it didn't handle arguments and offered no benefit over run_pyscript.