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.
pull/18116/head
Nikolai Lifanov 6 years ago
parent c1451e83d5
commit ad093660ff
  1. 19
      src/python/grpcio/commands.py

@ -149,10 +149,11 @@ def check_and_update_cythonization(extensions):
for source in extension.sources: for source in extension.sources:
base, file_ext = os.path.splitext(source) base, file_ext = os.path.splitext(source)
if file_ext == '.pyx': if file_ext == '.pyx':
generated_pyx_source = next((base + gen_ext for gen_ext in ( generated_pyx_source = next(
'.c', (base + gen_ext for gen_ext in (
'.cpp', '.c',
) if os.path.isfile(base + gen_ext)), None) '.cpp',
) if os.path.isfile(base + gen_ext)), None)
if generated_pyx_source: if generated_pyx_source:
generated_pyx_sources.append(generated_pyx_source) generated_pyx_sources.append(generated_pyx_source)
else: else:
@ -194,7 +195,8 @@ def try_cythonize(extensions, linetracing=False, mandatory=True):
return Cython.Build.cythonize( return Cython.Build.cythonize(
extensions, extensions,
include_path=[ include_path=[
include_dir for extension in extensions include_dir
for extension in extensions
for include_dir in extension.include_dirs for include_dir in extension.include_dirs
] + [CYTHON_STEM], ] + [CYTHON_STEM],
compiler_directives=cython_compiler_directives) 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 """Test if default compiler is okay with specifying c++ version
when invokec in C mode. GCC is okay with this, while clang is not. when invokec in C mode. GCC is okay with this, while clang is not.
""" """
cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'], cc_test = subprocess.Popen(
stdout=subprocess.PIPE, ['cc', '-x', 'c', '-std=c++11', '-'],
stderr=subprocess.PIPE) stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
_, cc_err = cc_test.communicate(input='int main(){return 0;}') _, cc_err = cc_test.communicate(input='int main(){return 0;}')
return not 'invalid argument' in cc_err return not 'invalid argument' in cc_err

Loading…
Cancel
Save