Issue 545436: py-execute-string doesn't work (original) (raw)

Issue545436

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/36456

classification

Title: py-execute-string doesn't work
Type: Stage:
Components: Demos and Tools Versions:

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, skip.montanaro
Priority: normal Keywords:

Created on 2002-04-18 00:25 by skip.montanaro, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
545436.py barry,2002-04-22 15:24
Messages (3)
msg10399 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2002-04-18 00:25
The python-mode function py-execute-string appears not to work. In XEmacs 21.4.6 I executed M-x py-execute-string print "hello world" and got a "No output." message. Stepping through the code using edebug it appears that in py-execute-region the local variable cmd (right after the "horrible hack" comment) is set to the empty string. I think it's because that chunk of code uses buffer-local info to determine what command to run. Executing py-execute-region from a fundamental-mode buffer also fails. Executing python-mode and then running it again succeeds. Adding (if (equal cmd "") (setq cmd "python")) right after cmd is set seems to make things work regardless of the buffer's mode.
msg10400 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2002-04-22 15:24
Logged In: YES user_id=12800 Skip, tell me what you think of the attached patch. It sets a local `shell' variable to the value of py-which-shell after setting the temporary file to python-mode.
msg10401 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2002-04-22 19:05
Logged In: YES user_id=44345 Seems to work for me, thanks. S
History
Date User Action Args
2022-04-10 16:05:14 admin set github: 36456
2002-04-18 00:25:31 skip.montanaro create

Supported by The Python Software Foundation,
Powered by Roundup

Copyright © 1990-2022, Python Software Foundation
Legal Statements