You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
venv/PyCharm 2025.2.1.1/plugins/python-ce/helpers/extra_syspath.py

19 lines
519 B

import sys, os
qualified_name = sys.argv[-1]
path = qualified_name.split(".")
try:
module = __import__(qualified_name, globals(), locals(), [path[-1]])
try:
module_path = module.__path__
if isinstance(module_path, str):
sys.stdout.write(os.sep.join(module_path.split(os.sep)[:-1]))
else:
paths = (os.sep.join(p.split(os.sep)[:-1]) for p in module_path)
sys.stdout.write(os.path.pathsep.join(paths))
sys.stdout.flush()
except AttributeError:
pass
except ImportError:
pass