mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cython speedups break debugging with Stackless (PY-23283)
The problem appears when compiling Cython extensions with Cython 0.25, and it doesn't appear when compiling them with Cython 0.24. It looks like it's Cython bug, but we can't use old version of Cython, because it isn't compatible with Python 3.6 on Windows. So we have to (temporarily) disable Cython extensions for Stackless despite the fact that its implementation is "CPython".
This commit is contained in:
@@ -51,6 +51,7 @@ if IS_JYTHON:
|
||||
if sys.version_info[0] == 2 and sys.version_info[1] < 5:
|
||||
IS_JYTH_LESS25 = True
|
||||
|
||||
IS_PYTHON_STACKLESS = "stackless" in sys.version.lower()
|
||||
CYTHON_SUPPORTED = False
|
||||
|
||||
try:
|
||||
@@ -59,7 +60,7 @@ try:
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
if python_implementation == 'CPython':
|
||||
if python_implementation == 'CPython' and not IS_PYTHON_STACKLESS:
|
||||
# Only available for CPython!
|
||||
if (
|
||||
(sys.version_info[0] == 2 and sys.version_info[1] >= 7)
|
||||
|
||||
@@ -2,8 +2,16 @@
|
||||
# Should give warning only here if cython is not available but supported.
|
||||
|
||||
import os
|
||||
use_cython = os.getenv('PYDEVD_USE_CYTHON', None)
|
||||
import sys
|
||||
from _pydevd_bundle.pydevd_constants import CYTHON_SUPPORTED
|
||||
|
||||
|
||||
use_cython = os.getenv('PYDEVD_USE_CYTHON', None)
|
||||
dirname = os.path.dirname(os.path.dirname(__file__))
|
||||
# Do not show incorrect warning for .egg files for Remote debugger
|
||||
if not CYTHON_SUPPORTED or dirname.endswith('.egg'):
|
||||
# Do not try to import cython extensions if cython isn't supported
|
||||
use_cython = 'NO'
|
||||
|
||||
|
||||
def delete_old_compiled_extensions():
|
||||
@@ -55,17 +63,10 @@ elif use_cython is None:
|
||||
except ImportError:
|
||||
from _pydevd_bundle.pydevd_additional_thread_info_regular import PyDBAdditionalThreadInfo # @UnusedImport
|
||||
from _pydevd_bundle.pydevd_trace_dispatch_regular import trace_dispatch, global_cache_skips, global_cache_frame_skips # @UnusedImport
|
||||
from _pydevd_bundle.pydevd_constants import CYTHON_SUPPORTED
|
||||
from _pydev_bundle.pydev_monkey import log_error_once
|
||||
|
||||
dirname = os.path.dirname(os.path.dirname(__file__))
|
||||
if dirname.endswith('.egg'):
|
||||
# Do not show incorrect warning for .egg files for Remote debugger
|
||||
CYTHON_SUPPORTED = False
|
||||
|
||||
if CYTHON_SUPPORTED:
|
||||
from _pydev_bundle.pydev_monkey import log_error_once
|
||||
log_error_once("warning: Debugger speedups using cython not found. Run '\"%s\" \"%s\" build_ext --inplace' to build." % (
|
||||
sys.executable, os.path.join(dirname, 'setup_cython.py')))
|
||||
log_error_once("warning: Debugger speedups using cython not found. Run '\"%s\" \"%s\" build_ext --inplace' to build." % (
|
||||
sys.executable, os.path.join(dirname, 'setup_cython.py')))
|
||||
|
||||
else:
|
||||
raise RuntimeError('Unexpected value for PYDEVD_USE_CYTHON: %s (accepted: YES, NO)' % (use_cython,))
|
||||
|
||||
Reference in New Issue
Block a user