Browse Source

Restoring authorship annotation for <viknet@yandex-team.ru>. Commit 2 of 2.

viknet 3 years ago
parent
commit
5fa8d46542

+ 1 - 1
build/platform/python/resources.inc

@@ -15,7 +15,7 @@ SET(PYTHON35_DARWIN sbr:426409804)
 SET(PYTHON36_DARWIN sbr:426412777)
 SET(PYTHON37_DARWIN sbr:616740054)
 SET(PYTHON38_DARWIN sbr:1211286783)
-SET(PYTHON39_DARWIN sbr:2046345566) 
+SET(PYTHON39_DARWIN sbr:2046345566)
 SET(PYTHON310_DARWIN sbr:2505677448)
 
 SET(PYTHON38_DARWIN_ARM64 sbr:2577173323)

+ 6 - 6
contrib/python/ya.make

@@ -218,14 +218,14 @@ RECURSE(
     django-admin-view-permission
     django-advanced-filters
     django-ajax-selects
-    django-alive 
+    django-alive
     django-autoconfig
     django-appconf
     django-bootstrap3
     django-braces
     django-bulk-update
     django-cachalot
-    django-cache-memoize 
+    django-cache-memoize
     django-celery-beat
     django-celery-email
     django-celery-results
@@ -238,7 +238,7 @@ RECURSE(
     django-csp
     django-cte
     django-datetime-widget
-    django-db-geventpool 
+    django-db-geventpool
     django-dbtemplates
     django-debug-panel
     django-debug-toolbar
@@ -255,7 +255,7 @@ RECURSE(
     django-fsm
     django-grappelli
     django-guardian
-    django-hosts 
+    django-hosts
     django-http-proxy
     django-import-export
     django-introspection
@@ -387,7 +387,7 @@ RECURSE(
     Flask-Babel
     Flask-Bootstrap
     Flask-Bootstrap/example
-    Flask-Caching 
+    Flask-Caching
     flask-cors
     flask_graphql
     Flask-Humanize
@@ -773,7 +773,7 @@ RECURSE(
     protobuf_std
     protobuf_to_dict
     psutil
-    psycogreen 
+    psycogreen
     psycopg2
     ptpython
     ptyprocess

+ 20 - 20
library/python/runtime_py3/importer.pxi

@@ -14,7 +14,7 @@ env_source_root = b'Y_PYTHON_SOURCE_ROOT'
 cfg_source_root = b'arcadia-source-root'
 env_extended_source_search = b'Y_PYTHON_EXTENDED_SOURCE_SEARCH'
 res_ya_ide_venv = b'YA_IDE_VENV'
-executable = sys.executable or 'Y_PYTHON' 
+executable = sys.executable or 'Y_PYTHON'
 sys.modules['run_import_hook'] = __resource
 
 # This is the prefix in contrib/tools/python3/src/Lib/ya.make.
@@ -180,7 +180,7 @@ class ResourceImporter(object):
         self.memory = set(iter_py_modules())  # Set of importable module names.
         self.source_map = {}                  # Map from file names to module names.
         self._source_name = {}                # Map from original to altered module names.
-        self._package_prefix = '' 
+        self._package_prefix = ''
         if Y_PYTHON_SOURCE_ROOT and Y_PYTHON_EXTENDED_SOURCE_SEARCH:
             self.arcadia_source_finder = ArcadiaSourceFinder(_s(Y_PYTHON_SOURCE_ROOT))
         else:
@@ -192,12 +192,12 @@ class ResourceImporter(object):
                 if k not in self.memory:
                     self.memory.add(k)
 
-    def for_package(self, name): 
-        import copy 
-        importer = copy.copy(self) 
-        importer._package_prefix = name + '.' 
-        return importer 
- 
+    def for_package(self, name):
+        import copy
+        importer = copy.copy(self)
+        importer._package_prefix = name + '.'
+        return importer
+
     def _find_mod_path(self, fullname):
         """Find arcadia relative path by module name"""
         relpath = resfs_src(mod_path(fullname), resfs_file=True)
@@ -222,8 +222,8 @@ class ResourceImporter(object):
 
     def exec_module(self, module):
         code = self.get_code(module.__name__)
-        module.__file__ = code.co_filename 
-        if self.is_package(module.__name__): 
+        module.__file__ = code.co_filename
+        if self.is_package(module.__name__):
             module.__path__= [executable + path_sep + module.__name__.replace('.', path_sep)]
         # exec(code, module.__dict__)
         _call_with_frames_removed(exec, code, module.__dict__)
@@ -321,14 +321,14 @@ class ResourceImporter(object):
 
         return b''
 
-    # Extension for pkgutil.iter_modules. 
-    def iter_modules(self, prefix=''): 
-        import re 
-        rx = re.compile(re.escape(self._package_prefix) + r'([^.]+)(\.__init__)?$') 
-        for p in self.memory: 
-            m = rx.match(p) 
-            if m: 
-                yield prefix + m.group(1), m.group(2) is not None 
+    # Extension for pkgutil.iter_modules.
+    def iter_modules(self, prefix=''):
+        import re
+        rx = re.compile(re.escape(self._package_prefix) + r'([^.]+)(\.__init__)?$')
+        for p in self.memory:
+            m = rx.match(p)
+            if m:
+                yield prefix + m.group(1), m.group(2) is not None
         if self.arcadia_source_finder:
             for m in self.arcadia_source_finder.iter_modules(self._package_prefix, prefix):
                 yield m
@@ -340,7 +340,7 @@ class ResourceImporter(object):
         except ImportError:
             return None
         return _ResfsResourceReader(self, fullname)
- 
+
 
 class _ResfsResourceReader:
 
@@ -540,7 +540,7 @@ def executable_path_hook(path):
 
     if path.startswith(executable + path_sep):
         return importer.for_package(path[len(executable + path_sep):].replace(path_sep, '.'))
- 
+
     raise ImportError(path)