Пример #1
0
 def test_get_path(self):
     if sys.platform == 'darwin' and sys._framework:
         scheme = 'osx_framework_user'
     else:
         scheme = os.name + '_user'
     self.assertEqual(site._get_path(site._getuserbase()),
                      sysconfig.get_path('purelib', scheme))
Пример #2
0
 def test_get_path(self):
     if sys.platform == 'darwin' and sys._framework:
         scheme = 'osx_framework_user'
     else:
         scheme = os.name + '_user'
     self.assertEqual(site._get_path(site._getuserbase()),
                      sysconfig.get_path('purelib', scheme))
Пример #3
0
 def test_get_path(self):
     self.assertEqual(site._get_path(site._getuserbase()),
                      sysconfig.get_path('purelib', os.name + '_user'))
Пример #4
0
 def test_get_path(self):
     self.assertEqual(site._get_path(site._getuserbase()),
                      sysconfig.get_path('purelib', os.name + '_user'))
Пример #5
0
 def update_event(self, inp=-1):
     self.set_output_val(0, site._get_path(self.input(0)))
Пример #6
0
import collections.abc
import contextlib
import importlib
import inspect
import json
import pydoc
import sys, re, io
import os, site

if 'VIRTUAL_ENV' in os.environ:
    # derived from activate_this.py from the virtualenv package
    base = os.environ['VIRTUAL_ENV']
    os.environ['PATH'] = os.pathsep.join([os.path.join(base, 'bin')] +
                                         os.environ['PATH'].split(os.pathsep))
    prev_length = len(sys.path)
    site.addsitedir(os.path.realpath(site._get_path(base)))
    sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]
    sys.prefix = base
sys.path.insert(0, '')

cache = lambda function: lru_cache(maxsize=128, typed=True)(function)

try:
    from pythonpy.__version__ import __version__
except (ImportError, ValueError, SystemError):
    __version__ = '0.5.3'

pyversion = sys.version.split(' ')[0]
version_string = f'''Pythonpy {__version__}
Python {pyversion}'''