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 | |
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')
-rw-r--r-- | library/python/certifi/ya.make | 2 | ||||
-rw-r--r-- | library/python/filelock/ut/lib/ya.make | 2 | ||||
-rw-r--r-- | library/python/filelock/ut/py2/ya.make | 2 | ||||
-rw-r--r-- | library/python/filelock/ut/py3/ya.make | 18 | ||||
-rw-r--r-- | library/python/filelock/ut/ya.make | 14 | ||||
-rw-r--r-- | library/python/fs/__init__.py | 12 | ||||
-rw-r--r-- | library/python/fs/clonefile.pyx | 30 | ||||
-rw-r--r-- | library/python/fs/ya.make | 18 | ||||
-rw-r--r-- | library/python/resource/__init__.py | 2 | ||||
-rw-r--r-- | library/python/resource/ut/py3/ya.make | 14 | ||||
-rw-r--r-- | library/python/resource/ut/ya.make | 6 | ||||
-rw-r--r-- | library/python/resource/ya.make | 2 | ||||
-rw-r--r-- | library/python/runtime_py3/importer.pxi | 20 | ||||
-rw-r--r-- | library/python/runtime_py3/ya.make | 4 |
14 files changed, 73 insertions, 73 deletions
diff --git a/library/python/certifi/ya.make b/library/python/certifi/ya.make index 64fefe2833e..bedb0188502 100644 --- a/library/python/certifi/ya.make +++ b/library/python/certifi/ya.make @@ -1,4 +1,4 @@ -PY23_LIBRARY() +PY23_LIBRARY() OWNER(orivej g:python-contrib) diff --git a/library/python/filelock/ut/lib/ya.make b/library/python/filelock/ut/lib/ya.make index f3f9da5a67e..66861ebab43 100644 --- a/library/python/filelock/ut/lib/ya.make +++ b/library/python/filelock/ut/lib/ya.make @@ -1,6 +1,6 @@ OWNER(g:yatool) -PY23_LIBRARY() +PY23_LIBRARY() TEST_SRCS(test_filelock.py) diff --git a/library/python/filelock/ut/py2/ya.make b/library/python/filelock/ut/py2/ya.make index 30b54e0232a..69123ee7b6f 100644 --- a/library/python/filelock/ut/py2/ya.make +++ b/library/python/filelock/ut/py2/ya.make @@ -3,7 +3,7 @@ OWNER(g:yatool) PY2TEST() PEERDIR( - library/python/filelock/ut/lib + library/python/filelock/ut/lib ) END() diff --git a/library/python/filelock/ut/py3/ya.make b/library/python/filelock/ut/py3/ya.make index 05a856a19a2..96ef14d7dfd 100644 --- a/library/python/filelock/ut/py3/ya.make +++ b/library/python/filelock/ut/py3/ya.make @@ -1,9 +1,9 @@ -OWNER(g:yatool) - -PY3TEST() - -PEERDIR( - library/python/filelock/ut/lib -) - -END() +OWNER(g:yatool) + +PY3TEST() + +PEERDIR( + library/python/filelock/ut/lib +) + +END() diff --git a/library/python/filelock/ut/ya.make b/library/python/filelock/ut/ya.make index 9280ea415e1..bc88ee5a3ed 100644 --- a/library/python/filelock/ut/ya.make +++ b/library/python/filelock/ut/ya.make @@ -1,7 +1,7 @@ -OWNER(g:yatool) - -RECURSE( - lib - py2 - py3 -) +OWNER(g:yatool) + +RECURSE( + lib + py2 + py3 +) diff --git a/library/python/fs/__init__.py b/library/python/fs/__init__.py index b1b7cde0799..cdd2cd28e24 100644 --- a/library/python/fs/__init__.py +++ b/library/python/fs/__init__.py @@ -466,14 +466,14 @@ def copytree3( def walk_relative(path, topdown=True, onerror=None, followlinks=False): for dirpath, dirnames, filenames in os.walk(path, topdown=topdown, onerror=onerror, followlinks=followlinks): yield os.path.relpath(dirpath, path), dirnames, filenames + +def supports_clone(): + if 'darwin' in sys.platform: + import platform -def supports_clone(): - if 'darwin' in sys.platform: - import platform - - return list(map(int, platform.mac_ver()[0].split('.'))) >= [10, 13] - return False + return list(map(int, platform.mac_ver()[0].split('.'))) >= [10, 13] + return False def commonpath(paths): diff --git a/library/python/fs/clonefile.pyx b/library/python/fs/clonefile.pyx index 830bb894f2e..c7e834a4d8a 100644 --- a/library/python/fs/clonefile.pyx +++ b/library/python/fs/clonefile.pyx @@ -1,18 +1,18 @@ import six -cdef extern from "sys/clonefile.h" nogil: - int clonefile(const char * src, const char * dst, int flags) - -cdef extern from "Python.h": - ctypedef struct PyObject - cdef PyObject *PyExc_OSError - PyObject *PyErr_SetFromErrno(PyObject *) - -cdef int _macos_clone_file(const char* src, const char* dst) except? 0: - if clonefile(src, dst, 0) == -1: - PyErr_SetFromErrno(PyExc_OSError) - return 0 - return 1 - -def macos_clone_file(src, dst): +cdef extern from "sys/clonefile.h" nogil: + int clonefile(const char * src, const char * dst, int flags) + +cdef extern from "Python.h": + ctypedef struct PyObject + cdef PyObject *PyExc_OSError + PyObject *PyErr_SetFromErrno(PyObject *) + +cdef int _macos_clone_file(const char* src, const char* dst) except? 0: + if clonefile(src, dst, 0) == -1: + PyErr_SetFromErrno(PyExc_OSError) + return 0 + return 1 + +def macos_clone_file(src, dst): return _macos_clone_file(six.ensure_binary(src), six.ensure_binary(dst)) != 0 diff --git a/library/python/fs/ya.make b/library/python/fs/ya.make index b3c5092c716..70a2dadb4f8 100644 --- a/library/python/fs/ya.make +++ b/library/python/fs/ya.make @@ -2,16 +2,16 @@ OWNER(g:yatool) PY23_LIBRARY() -PY_SRCS( - __init__.py -) - -IF (OS_DARWIN) - PY_SRCS( - clonefile.pyx - ) -ENDIF() +PY_SRCS( + __init__.py +) +IF (OS_DARWIN) + PY_SRCS( + clonefile.pyx + ) +ENDIF() + PEERDIR( library/python/func library/python/strings diff --git a/library/python/resource/__init__.py b/library/python/resource/__init__.py index 26503ef7fce..fdf7ea4850f 100644 --- a/library/python/resource/__init__.py +++ b/library/python/resource/__init__.py @@ -3,7 +3,7 @@ from __res import resfs_read, resfs_resolve, resfs_src # noqa import six - + def iterkeys(prefix='', strip_prefix=False): decode = lambda s: s if isinstance(prefix, six.text_type): diff --git a/library/python/resource/ut/py3/ya.make b/library/python/resource/ut/py3/ya.make index 64eb2e83ce0..5bcde62e2b5 100644 --- a/library/python/resource/ut/py3/ya.make +++ b/library/python/resource/ut/py3/ya.make @@ -1,9 +1,9 @@ -PY3TEST() - +PY3TEST() + OWNER(pg) - -PEERDIR( + +PEERDIR( library/python/resource/ut/lib -) - -END() +) + +END() diff --git a/library/python/resource/ut/ya.make b/library/python/resource/ut/ya.make index a5ec192d743..92185ec9765 100644 --- a/library/python/resource/ut/ya.make +++ b/library/python/resource/ut/ya.make @@ -1,6 +1,6 @@ OWNER(pg) -RECURSE( - py2 - py3 +RECURSE( + py2 + py3 ) diff --git a/library/python/resource/ya.make b/library/python/resource/ya.make index 989329fa4b5..bc1ee77fe15 100644 --- a/library/python/resource/ya.make +++ b/library/python/resource/ya.make @@ -1,4 +1,4 @@ -PY23_LIBRARY() +PY23_LIBRARY() OWNER(pg) diff --git a/library/python/runtime_py3/importer.pxi b/library/python/runtime_py3/importer.pxi index 904f94dea2b..fd0d286fdad 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: diff --git a/library/python/runtime_py3/ya.make b/library/python/runtime_py3/ya.make index fa5c11341ad..a3b8a8b4d13 100644 --- a/library/python/runtime_py3/ya.make +++ b/library/python/runtime_py3/ya.make @@ -1,4 +1,4 @@ -PY3_LIBRARY() +PY3_LIBRARY() OWNER( borman @@ -20,7 +20,7 @@ NO_PYTHON_INCLUDES() ENABLE(PYBUILD_NO_PYC) -PY_SRCS( +PY_SRCS( entry_points.py TOP_LEVEL |