Disabling the magic "last expression" _ variable

K

Koen Vossen

A project I'm currently working on uses Turbogears as a framework. I'd
like to interact with it using the tg-admin shell. We also use gettext's
_() function for internationalization. Now, this function is overwritten
in interactive mode, which causes annoying exceptions. Is it possible to
disable this behavior?
 
P

Peter Otten

Koen said:
A project I'm currently working on uses Turbogears as a framework. I'd
like to interact with it using the tg-admin shell. We also use gettext's
_() function for internationalization. Now, this function is overwritten
in interactive mode, which causes annoying exceptions. Is it possible to
disable this behavior?
.... if result is not None:
.... __builtins__._last = result
.... print result
....Traceback (most recent call last):
yadda

Peter
 
P

Peter Otten

Koen said:
A project I'm currently working on uses Turbogears as a framework. I'd
like to interact with it using the tg-admin shell. We also use gettext's
_() function for internationalization. Now, this function is overwritten
in interactive mode, which causes annoying exceptions. Is it possible to
disable this behavior?

[correct overzealous snip]
.... if result is not None:
.... __builtins__._last = result
.... print result
....Traceback (most recent call last):
Traceback (most recent call last):
yadda


Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top