Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
if not tester_t.global_ns:
decls = parser.parse([self.header], self.config)
tester_t.global_ns = declarations.get_global_namespace(decls)
tester_t.global_ns.init_optimizer()
process = subprocess.Popen(
args='scons msvc_compiler=%s' %
autoconfig.cxx_parsers_cfg.gccxml.compiler,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd=self.binary_parsers_dir)
process.stdin.close()
while process.poll() is None:
line = process.stdout.readline()
print(line.rstrip())
for line in process.stdout.readlines():
print(line.rstrip())
if process.returncode:
raise RuntimeError(
("unable to compile binary parser module. " +
"See output for the errors."))