aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/src/python/grpcio/commands.py
diff options
context:
space:
mode:
authordvshkurko <dvshkurko@yandex-team.ru>2022-02-10 16:45:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:52 +0300
commitc768a99151e47c3a4bb7b92c514d256abd301c4d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/grpc/src/python/grpcio/commands.py
parent321ee9bce31ec6e238be26dbcbe539cffa2c3309 (diff)
downloadydb-c768a99151e47c3a4bb7b92c514d256abd301c4d.tar.gz
Restoring authorship annotation for <dvshkurko@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/grpc/src/python/grpcio/commands.py')
-rw-r--r--contrib/libs/grpc/src/python/grpcio/commands.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/contrib/libs/grpc/src/python/grpcio/commands.py b/contrib/libs/grpc/src/python/grpcio/commands.py
index dcb2ce5a53..8240beb295 100644
--- a/contrib/libs/grpc/src/python/grpcio/commands.py
+++ b/contrib/libs/grpc/src/python/grpcio/commands.py
@@ -212,43 +212,43 @@ class BuildExt(build_ext.build_ext):
LINK_OPTIONS = {}
def build_extensions(self):
-
- def compiler_ok_with_extra_std():
- """Test if default compiler is okay with specifying c++ version
- when invoked in C mode. GCC is okay with this, while clang is not.
- """
+
+ def compiler_ok_with_extra_std():
+ """Test if default compiler is okay with specifying c++ version
+ when invoked in C mode. GCC is okay with this, while clang is not.
+ """
if platform.system() != 'Windows':
return False
- # TODO(lidiz) Remove the generated a.out for success tests.
+ # TODO(lidiz) Remove the generated a.out for success tests.
cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- _, cc_err = cc_test.communicate(input=b'int main(){return 0;}')
- return not 'invalid argument' in str(cc_err)
-
+ _, cc_err = cc_test.communicate(input=b'int main(){return 0;}')
+ return not 'invalid argument' in str(cc_err)
+
# This special conditioning is here due to difference of compiler
# behavior in gcc and clang. The clang doesn't take --stdc++11
# flags but gcc does. Since the setuptools of Python only support
# all C or all C++ compilation, the mix of C and C++ will crash.
- # *By default*, macOS and FreBSD use clang and Linux use gcc
- #
- # If we are not using a permissive compiler that's OK with being
- # passed wrong std flags, swap out compile function by adding a filter
- # for it.
- if not compiler_ok_with_extra_std():
- old_compile = self.compiler._compile
-
- def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
- if src[-2:] == '.c':
- extra_postargs = [
- arg for arg in extra_postargs if not '-std=c++' in arg
- ]
- return old_compile(obj, src, ext, cc_args, extra_postargs,
- pp_opts)
-
- self.compiler._compile = new_compile
-
+ # *By default*, macOS and FreBSD use clang and Linux use gcc
+ #
+ # If we are not using a permissive compiler that's OK with being
+ # passed wrong std flags, swap out compile function by adding a filter
+ # for it.
+ if not compiler_ok_with_extra_std():
+ old_compile = self.compiler._compile
+
+ def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
+ if src[-2:] == '.c':
+ extra_postargs = [
+ arg for arg in extra_postargs if not '-std=c++' in arg
+ ]
+ return old_compile(obj, src, ext, cc_args, extra_postargs,
+ pp_opts)
+
+ self.compiler._compile = new_compile
+
compiler = self.compiler.compiler_type
if compiler in BuildExt.C_OPTIONS:
for extension in self.extensions: