diff options
author | spreis <spreis@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
commit | bcd1126cbd5d445cd0665d295198aa39c6ab8cbe (patch) | |
tree | d41d29a041d5733ef148335290dbb817b197d4cd /library/python/runtime_py3/importer.pxi | |
parent | 986cb5d624f352524bfa0c42c9a7695235cdaa41 (diff) | |
download | ydb-bcd1126cbd5d445cd0665d295198aa39c6ab8cbe.tar.gz |
Restoring authorship annotation for <spreis@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/runtime_py3/importer.pxi')
-rw-r--r-- | library/python/runtime_py3/importer.pxi | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/python/runtime_py3/importer.pxi b/library/python/runtime_py3/importer.pxi index 904f94dea2..fd0d286fda 100644 --- a/library/python/runtime_py3/importer.pxi +++ b/library/python/runtime_py3/importer.pxi @@ -110,8 +110,8 @@ def iter_py_modules(with_keys=False): yield key, mod else: yield mod - - + + def iter_prefixes(s): i = s.find('.') while i >= 0: @@ -119,7 +119,7 @@ def iter_prefixes(s): i = s.find('.', i + 1) -def resfs_resolve(path): +def resfs_resolve(path): """ Return the absolute path of a root-relative path if it exists. """ @@ -140,7 +140,7 @@ def resfs_src(key, resfs_file=False): return __resource.find(b'resfs/src/' + _b(key)) -def resfs_read(path, builtin=None): +def resfs_read(path, builtin=None): """ Return the bytes of the resource file at path, or None. If builtin is True, do not look for it on the filesystem. @@ -165,11 +165,11 @@ def resfs_files(prefix=b''): def mod_path(mod): - """ + """ Return the resfs path to the source code of the module with the given name. - """ + """ return py_prefix + _b(mod).replace(b'.', b'/') + b'.py' - + class ResourceImporter(object): @@ -279,12 +279,12 @@ class ResourceImporter(object): data = file_bytes(abspath) return compile(data, _s(abspath), 'exec', dont_inherit=True) - yapyc_path = path + b'.yapyc3' - yapyc_data = resfs_read(yapyc_path, builtin=True) + yapyc_path = path + b'.yapyc3' + yapyc_data = resfs_read(yapyc_path, builtin=True) if yapyc_data: return marshal.loads(yapyc_data) else: - py_data = resfs_read(path, builtin=True) + py_data = resfs_read(path, builtin=True) if py_data: return compile(py_data, _s(relpath), 'exec', dont_inherit=True) else: |