Returns the user-specific site-packages directory path. If the global variable ``USER_SITE`` is not initialized yet, this function will also set it.
()
| 348 | |
| 349 | |
| 350 | def getusersitepackages(): |
| 351 | """Returns the user-specific site-packages directory path. |
| 352 | |
| 353 | If the global variable ``USER_SITE`` is not initialized yet, this |
| 354 | function will also set it. |
| 355 | """ |
| 356 | global USER_SITE, ENABLE_USER_SITE |
| 357 | userbase = getuserbase() # this will also set USER_BASE |
| 358 | |
| 359 | if USER_SITE is None: |
| 360 | if userbase is None: |
| 361 | ENABLE_USER_SITE = False # disable user site and return None |
| 362 | else: |
| 363 | USER_SITE = _get_path(userbase) |
| 364 | |
| 365 | return USER_SITE |
| 366 | |
| 367 | def addusersitepackages(known_paths): |
| 368 | """Add a per user site-package to sys.path |
no test coverage detected
searching dependent graphs…