From b30c8b29158c3493582bdf7bb362dba2eeeb3d40 Mon Sep 17 00:00:00 2001 From: Andrey Lisin Date: Wed, 27 Jul 2022 10:22:17 +0200 Subject: [PATCH] PY-48506 `os.PathLike` is only available in Python 3.6 and above GitOrigin-RevId: 23e5e900cc9a9faa32703cbd8ea4b19141dd86c2 --- python/helpers/pydev/_pydev_bundle/pydev_monkey.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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]