Issue499973
Created on 2002-01-05.21:51:32 by bckfnn, last changed 2002-01-05.21:51:32 by bckfnn.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2002-01-05 21:51:32 | bckfnn | create | |
Created on 2002-01-05.21:51:32 by bckfnn, last changed 2002-01-05.21:51:32 by bckfnn.
| Messages | |||
|---|---|---|---|
| msg546 (view) | Author: Finn Bock (bckfnn) | Date: 2002-01-05.21:51:32 | |
The __str__() method of the isql.Prompt class isn't
magicly called when sys.stdout.write(self.prompt) is
called. It result in a stacktrace:
Jython 2.1 on java1.3.0 (JIT: null)
Type "copyright", "credits" or "license" for more
information.
>>> import dbexts, isql
>>> d=3Ddbexts.dbexts("prod_sport")
>>> D=3Disql.IsqlCmd(d)
>>> D.use_rawinput=3D0
>>> D.cmdloop()
Traceback (innermost last):
File "<console>", line 1, in ?
File "/usr/local/jython/jython-2.1/Lib/cmd.py", line
79, in cmdloop
TypeError: write(): 1st arg can't be coerced to String
I'm not sure that this have ever worked. Adding a
__tojava__ method to the Prompt class seems to fix the
problem.
def __tojava__(self, cls):
if cls == java.lang.String:
return self.__str__()
return None
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2002-01-05 21:51:32 | bckfnn | create | |
Supported by Python Software Foundation,
Powered by Roundup