Skip to content

Commit c844256

Browse files
committed
Remove try/except
1 parent 3bae429 commit c844256

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

tools/wasm-sourcemap.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -241,23 +241,19 @@ def demangle_names(names):
241241
return {}
242242

243243
# Gather all mangled names and call llvm-cxxfilt only once for all of them
244-
try:
245-
input_str = '\n'.join(mangled_names)
246-
proc = shared.check_call([LLVM_CXXFILT], input=input_str, stdout=shared.PIPE, stderr=shared.PIPE, text=True)
247-
if proc.returncode != 0:
248-
logger.warning('llvm-cxxfilt failed: %s' % proc.stderr)
249-
return {}
250-
251-
demangled_list = proc.stdout.splitlines()
252-
if len(demangled_list) != len(mangled_names):
253-
logger.warning('llvm-cxxfilt output length mismatch')
254-
return {}
255-
256-
return dict(zip(mangled_names, demangled_list))
257-
except OSError:
258-
logger.warning('Failed to run llvm-cxxfilt')
244+
input_str = '\n'.join(mangled_names)
245+
proc = shared.check_call([LLVM_CXXFILT], input=input_str, stdout=shared.PIPE, stderr=shared.PIPE, text=True)
246+
if proc.returncode != 0:
247+
logger.warning('llvm-cxxfilt failed: %s' % proc.stderr)
259248
return {}
260249

250+
demangled_list = proc.stdout.splitlines()
251+
if len(demangled_list) != len(mangled_names):
252+
logger.warning('llvm-cxxfilt output length mismatch')
253+
return {}
254+
255+
return dict(zip(mangled_names, demangled_list))
256+
261257

262258
class FuncRange:
263259
def __init__(self, name, low_pc, high_pc):

0 commit comments

Comments
 (0)