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.

classification
Title: rexec: all s_* methods return None only
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: aleax, gvanrossum
Priority: normal Keywords:

Created on 2001-06-17 13:04 by aleax, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rexec.txt gvanrossum, 2001-06-17 21:38 Patch
Messages (4)
msg5095 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2001-06-17 13:04
D:\py21>python
Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license" for more 
information.
>>> import rexec
>>> r=rexec.RExec()
>>> x=r.r_eval('2+2')
>>> print x
4
>>> x=r.s_eval('2+2')
>>> print x
None
>>>

Cause: method s_apply lacks a 'return r' at the end, 
and all the other s_* methods should be 'return 
self.s_apply(...' but are in fact lacking the return 
keyword (they just call s_apply but ignore its result).


Alex
msg5096 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-06-17 21:38
Logged In: YES 
user_id=6380

Good catch.  You see, rexec hasn't exactly been miss
popularity...

Does the attached patch fix this for you?
msg5097 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2001-06-18 06:59
Logged In: YES 
user_id=60314

Yep, the patch is of course perfect, thanks.  Hope it makes 
it into 2.1.1 as it's so obviously flawless & necessary.
(I had never used the s_* methods, but I'm religiously 
checking everything I'm writing about for the Nutshell 
book, so...:-).

Alex
msg5098 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-06-18 12:34
Logged In: YES 
user_id=6380

Fixed, rexec.py 1.29 and 1.28.4.1.
History
Date User Action Args
2022-04-10 16:04:08adminsetgithub: 34642
2001-06-17 13:04:55aleaxcreate