cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
<mgedmin>
"defining the Py_DEBUG macro no longer implies the Py_TRACE_REFS macro"
<mgedmin>
"The Py_TRACE_REFS macro, which adds the sys.getobjects() function and the PYTHONDUMPREFS environment variable, can be set using the new ./configure --with-trace-refs build option."
<tumbleweed>
according to setup.py:
<tumbleweed>
'--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")
<arigato>
mgedmin: thanks, but still sys.flags.debug==0
<arigato>
also, if I make a virtualenv with the uninstalled python then it no longer finds <Python.h>
<arigato>
which I'm pretty sure used to work
<mgedmin>
sys.flags.debug is for the -d command-line argument, which turns on parser debugging output?
<tumbleweed>
virtualenv got rewritten, things that used to work don't necessarily any more
<tumbleweed>
mgedmin: ah, right
<arigato>
...ah, yes, I see why it's not finding Python.h. sorry
<arigato>
OK so we don't have any way to know if a python was built in debug mode?
<tumbleweed>
the sysconfig check above
<tumbleweed>
it's hacky, but also directly from cpython's setup.py :)
<arigato>
OK
<tumbleweed>
hasattr(sys, 'gettotalrefcount') works too
<tumbleweed>
(even if it doesn't print [ref: ...]
<tumbleweed>
that's commonly used in the stdlib
lritter has joined #pypy
rfgpfeiffer has joined #pypy
fling has quit [Ping timeout: 260 seconds]
fling has joined #pypy
_whitelogger has joined #pypy
jcea has joined #pypy
rfgpfeiffer has quit [Remote host closed the connection]
epony has quit [Quit: cya (ame) in 10 minutes for sysupgrades.. you should upgrade too, NWO!]
epony has joined #pypy
<rjarry>
guys, I have an issue with @def_extern functions
<rjarry>
basically, I register a callback in a C library with a @def_extern function
<rjarry>
and I have a SIGTERM handler which performs sys.exit(1)
<rjarry>
this causes the SystemExit exception to be injected into the frame of the @def_extern function
<rjarry>
which in turn, is swallowed by cffi wrapper
<rjarry>
do you have a solution ?
<rjarry>
I have the feeling that signals should be masked before calling python code from C
<rjarry>
at least it should be possible to do something like: