mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
use threading.__file__ als last fallback
This commit is contained in:
parent
e7bcae3ed8
commit
e9785ca87c
1 changed files with 6 additions and 3 deletions
|
|
@ -89,10 +89,13 @@ def _get_library_dir():
|
|||
|
||||
if library_dir is None or not os_path_exists(library_dir):
|
||||
if hasattr(os, "__file__"):
|
||||
# "os" is a frozen import an thus "os.__file__" is not always set.
|
||||
# See https://github.com/python/cpython/pull/28656
|
||||
library_dir = os.path.dirname(os.__file__)
|
||||
|
||||
if library_dir is None:
|
||||
library_dir = "" # not possible to detect library_dir
|
||||
else:
|
||||
# "threading" is not a frozen import an thus "threading.__file__" is always set.
|
||||
import threading
|
||||
library_dir = os.path.dirname(threading.__file__)
|
||||
|
||||
return library_dir
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue