mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
PY-48506 #pr2032 Support PathLike objects for subprocess
This fixes https://youtrack.jetbrains.com/issue/PY-48506/error-on-pydevmonkey-in-debug-mode-AttributeError-PosixPath-object-has-no-attribute-endswith by checking if the path is `PathLike`, and calling `__fspath__()` to get the string version of the path. GitOrigin-RevId: 012913359ea48e2798a80ebe2d0732ba8297daa7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
181b975dfa
commit
2381494f91
@@ -108,6 +108,8 @@ def starts_with_python_shebang(path):
|
||||
|
||||
|
||||
def is_python(path):
|
||||
if isinstance(path, os.PathLike):
|
||||
path = path.__fspath__()
|
||||
if path.endswith("'") or path.endswith('"'):
|
||||
path = path[1:len(path) - 1]
|
||||
filename = os.path.basename(path).lower()
|
||||
|
||||
Reference in New Issue
Block a user