[pypy-commit] pypy vmprof-newstack: Write a warning if _continuation is imported when we call _vmprof.enable()

arigo pypy.commits at gmail.com
Fri Jan 15 04:03:41 EST 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: vmprof-newstack
Changeset: r81778:63917019c08b
Date: 2016-01-15 09:51 +0100
http://bitbucket.org/pypy/pypy/changeset/63917019c08b/

Log:	Write a warning if _continuation is imported when we call
	_vmprof.enable()

diff --git a/pypy/module/_vmprof/interp_vmprof.py b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -59,6 +59,11 @@
     'interval' is a float representing the sampling interval, in seconds.
     Must be smaller than 1.0
     """
+    w_modules = space.sys.get('modules')
+    if space.contains(w_modules, space.wrap('_continuation')):
+        space.warn(space.wrap("Using _continuation/greenlet/stacklet together "
+                              "with vmprof will crash"),
+                   space.w_RuntimeWarning)
     try:
         rvmprof.enable(fileno, period)
     except rvmprof.VMProfError, e:


More information about the pypy-commit mailing list