MCPcopy Index your code
hub / github.com/python/cpython / _get_path

Function _get_path

Lib/site.py:318–334  ·  view source on GitHub ↗
(userbase)

Source from the content-addressed store, hash-verified

316
317# Same to sysconfig.get_path('purelib', os.name+'_user')
318def _get_path(userbase):
319 version = sys.version_info
320 if hasattr(sys, 'abiflags') and 't' in sys.abiflags:
321 abi_thread = 't'
322 else:
323 abi_thread = ''
324
325 implementation = _get_implementation()
326 implementation_lower = implementation.lower()
327 if os.name == 'nt':
328 ver_nodot = sys.winver.replace('.', '')
329 return f'{userbase}\\{implementation}{ver_nodot}\\site-packages'
330
331 if sys.platform == 'darwin' and sys._framework:
332 return f'{userbase}/lib/{implementation_lower}/site-packages'
333
334 return f'{userbase}/lib/{implementation_lower}{version[0]}.{version[1]}{abi_thread}/site-packages'
335
336
337def getuserbase():

Callers 1

getusersitepackagesFunction · 0.85

Calls 3

_get_implementationFunction · 0.70
lowerMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…