diff --git a/python/helpers/pydev/_pydev_bundle/pydev_monkey.py b/python/helpers/pydev/_pydev_bundle/pydev_monkey.py index 0f0db77023f0..05c552c250e0 100644 --- a/python/helpers/pydev/_pydev_bundle/pydev_monkey.py +++ b/python/helpers/pydev/_pydev_bundle/pydev_monkey.py @@ -3,7 +3,8 @@ import os import sys import traceback from _pydev_imps._pydev_saved_modules import threading -from _pydevd_bundle.pydevd_constants import get_global_debugger, IS_WINDOWS, IS_MACOS, IS_JYTHON, IS_PY36_OR_LESSER, IS_PY38_OR_GREATER, \ +from _pydevd_bundle.pydevd_constants import get_global_debugger, IS_WINDOWS, IS_MACOS, \ + IS_JYTHON, IS_PY36_OR_LESSER, IS_PY36_OR_GREATER, IS_PY38_OR_GREATER, \ get_current_thread_id from _pydev_bundle import pydev_log @@ -108,7 +109,7 @@ def starts_with_python_shebang(path): def is_python(path): - if isinstance(path, os.PathLike): + if IS_PY36_OR_GREATER and isinstance(path, os.PathLike): path = path.__fspath__() if path.endswith("'") or path.endswith('"'): path = path[1:len(path) - 1]