Allow '-' in OutputFormat enum parsing (#4850)
diff --git a/bindings/python/pyiree/compiler2/core.py b/bindings/python/pyiree/compiler2/core.py
index eea79fd..d93b7a4 100644
--- a/bindings/python/pyiree/compiler2/core.py
+++ b/bindings/python/pyiree/compiler2/core.py
@@ -53,7 +53,7 @@
"""
if isinstance(spec, OutputFormat):
return spec
- spec = spec.upper()
+ spec = spec.upper().replace("-", "_")
if spec not in OutputFormat.__members__:
raise ValueError(f"For output_format= argument, expected one of: "
f"{', '.join(OutputFormat.__members__.keys())}")