MCPcopy Index your code
hub / github.com/RustPython/RustPython / _get_path

Function _get_path

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

Source from the content-addressed store, hash-verified

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

Callers 1

getusersitepackagesFunction · 0.85

Calls 4

hasattrFunction · 0.85
_get_implementationFunction · 0.70
lowerMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected