From ad093660ffceb27d2bf69c41e06c7a5ea8024e3d Mon Sep 17 00:00:00 2001 From: Nikolai Lifanov Date: Thu, 21 Feb 2019 16:15:33 -0800 Subject: [PATCH] format with yapf This was already formatted with yapf, but perhaps I didn't do this correctly. I copied the diff directly from kokoro build log this time. --- src/python/grpcio/commands.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index ec03cbf4992..e80b90c6a34 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -149,10 +149,11 @@ def check_and_update_cythonization(extensions): for source in extension.sources: base, file_ext = os.path.splitext(source) if file_ext == '.pyx': - generated_pyx_source = next((base + gen_ext for gen_ext in ( - '.c', - '.cpp', - ) if os.path.isfile(base + gen_ext)), None) + generated_pyx_source = next( + (base + gen_ext for gen_ext in ( + '.c', + '.cpp', + ) if os.path.isfile(base + gen_ext)), None) if generated_pyx_source: generated_pyx_sources.append(generated_pyx_source) else: @@ -194,7 +195,8 @@ def try_cythonize(extensions, linetracing=False, mandatory=True): return Cython.Build.cythonize( extensions, include_path=[ - include_dir for extension in extensions + include_dir + for extension in extensions for include_dir in extension.include_dirs ] + [CYTHON_STEM], compiler_directives=cython_compiler_directives) @@ -215,9 +217,10 @@ class BuildExt(build_ext.build_ext): """Test if default compiler is okay with specifying c++ version when invokec in C mode. GCC is okay with this, while clang is not. """ - cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + cc_test = subprocess.Popen( + ['cc', '-x', 'c', '-std=c++11', '-'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) _, cc_err = cc_test.communicate(input='int main(){return 0;}') return not 'invalid argument' in cc_err