[pypy-dev] debug(read source code and test) pypy in pydev

Amaury Forgeot d'Arc amauryfa at gmail.com
Thu Jul 5 14:41:16 CEST 2007


Hello,

Wang Chunming wrote:
> Hi,
>    I am a newbie to python and pypy. I choose to read pypy source code
> to learn about python and python library. But when I try to run pypy
> in debug mode in pydev, I got the following problem:
[Traceback]
>
>    I try to figure out why this exception or error come out. I found
> that py.py import option.py, and option.py import pypyoption.py, and
> pypyoption.py import py.py again. Is this the problem of pypy(I don't
> think so), or the problem of pydev debugger, or something else? why?
>   Any comments or assistance that can light up the way are much
> appreciated.Thanks.

There are two "py" involved here:
- you are running the py.py script
- the other is the py library: http://codespeak.net/py/dist/

Normally, this does not cause any problem, but Pydev seems to tweak
the pythonpath and adds several entries...
Try to set the current directory to E:\Java\pySamples\pypy\bin\
(In eclipse, open the "Run/Debug..." window, and select the "Arguments tab")
Or you could just rename py.py to something else (runpy.py for example).

Note that because of a python bug, you cannot use python 2.5 to debug pypy.
(A strange interaction between generator destructors, the sys.settrace
function and the current thread state. www.python.org/sf/1733973 shows
a simple case, filed by the pydev developer)
Python 2.4 seems to work correctly.

Hope this helps,

--
Amaury Forgeot d'Arc



More information about the Pypy-dev mailing list