[CI] Updated by review (#36083)

Updated by review & Added missing import.

Closes #36083

PiperOrigin-RevId: 614017839
pull/36091/head
Esun Kim 1 year ago committed by Copybara-Service
parent ed8af1fb82
commit b78f64569a
  1. 4
      src/python/grpcio/commands.py
  2. 5
      tools/distrib/python/grpcio_tools/setup.py

@ -284,11 +284,11 @@ class BuildExt(build_ext.build_ext):
def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
if src.endswith(".c"):
extra_postargs = [
arg for arg in extra_postargs if not "-std=c++" in arg
arg for arg in extra_postargs if "-std=c++" not in arg
]
elif src.endswith(".cc") or src.endswith(".cpp"):
extra_postargs = [
arg for arg in extra_postargs if not "-std=gnu99" in arg
arg for arg in extra_postargs if "-std=gnu99" not in arg
]
return old_compile(
obj, src, ext, cc_args, extra_postargs, pp_opts

@ -23,6 +23,7 @@ import subprocess
from subprocess import PIPE
import sys
import sysconfig
import traceback
import setuptools
from setuptools import Extension
@ -141,11 +142,11 @@ class BuildExt(build_ext.build_ext):
def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
if src.endswith(".c"):
extra_postargs = [
arg for arg in extra_postargs if not "-std=c++" in arg
arg for arg in extra_postargs if "-std=c++" not in arg
]
elif src.endswith(".cc") or src.endswith(".cpp"):
extra_postargs = [
arg for arg in extra_postargs if not "-std=c11" in arg
arg for arg in extra_postargs if "-std=c11" not in arg
]
return old_compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

Loading…
Cancel
Save