aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/fs
diff options
context:
space:
mode:
authorspreis <spreis@yandex-team.ru>2022-02-10 16:47:13 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:13 +0300
commitb49848d6e361b76904f094b7d5e10d6edea75afe (patch)
tree9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/python/fs
parentbcd1126cbd5d445cd0665d295198aa39c6ab8cbe (diff)
downloadydb-b49848d6e361b76904f094b7d5e10d6edea75afe.tar.gz
Restoring authorship annotation for <spreis@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/fs')
-rw-r--r--library/python/fs/__init__.py12
-rw-r--r--library/python/fs/clonefile.pyx30
-rw-r--r--library/python/fs/ya.make18
3 files changed, 30 insertions, 30 deletions
diff --git a/library/python/fs/__init__.py b/library/python/fs/__init__.py
index cdd2cd28e2..b1b7cde079 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
- return list(map(int, platform.mac_ver()[0].split('.'))) >= [10, 13]
- return False
+def supports_clone():
+ if 'darwin' in sys.platform:
+ import platform
+
+ 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 c7e834a4d8..830bb894f2 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 70a2dadb4f..b3c5092c71 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
-)
+PY_SRCS(
+ __init__.py
+)
+
+IF (OS_DARWIN)
+ PY_SRCS(
+ clonefile.pyx
+ )
+ENDIF()
-IF (OS_DARWIN)
- PY_SRCS(
- clonefile.pyx
- )
-ENDIF()
-
PEERDIR(
library/python/func
library/python/strings