Skip to content

Commit ddac793

Browse files
committed
Always install the monkeypatch
1 parent 6ce0cad commit ddac793

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

cuda_core/cuda/core/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def _import_versioned_module():
2929

3030

3131
def _patch_rlcompleter_for_cython_properties():
32+
# TODO: This can be removed when Python 3.13 is our minimum-supported version:
33+
# https://github.com/python/cpython/pull/149577
34+
3235
# Cython @property on cdef class compiles to a C-level getset_descriptor,
3336
# which rlcompleter's narrow isinstance(..., property) check misses; the
3437
# fallback getattr() then invokes the descriptor and any non-AttributeError
@@ -37,15 +40,11 @@ def _patch_rlcompleter_for_cython_properties():
3740
# interactive mode so library users running scripts see no global
3841
# rlcompleter side effect.
3942
import os
40-
import sys
4143

4244
if os.environ.get("CUDA_CORE_DONT_FIX_TAB_COMPLETION"):
4345
# Explicit opt-out for users who don't want the global rlcompleter
4446
# side effect, even in an interactive session.
4547
return
46-
if not (hasattr(sys, "ps1") or sys.flags.inspect):
47-
# Plain `python script.py`, `python -c ...`, pytest, etc.
48-
return
4948

5049
import rlcompleter
5150
from types import GetSetDescriptorType, MemberDescriptorType

0 commit comments

Comments
 (0)