Skip to content

Commit deb39ec

Browse files
committed
fix optional
1 parent fbbf946 commit deb39ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

onnx_diagnostic/helpers/config_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def config_class_from_architecture(arch: str, exc: bool = False) -> Optional[typ
9595
mod_name = cls.__module__
9696
mod = importlib.import_module(mod_name)
9797
source = inspect.getsource(mod)
98-
reg = re.compile("config: ([A-Za-z0-9]+)")
98+
# [^O] avoids capturing Optional[Something]
99+
reg = re.compile("config: ([^O][A-Za-z0-9]+)")
99100
fall = reg.findall(source)
100101
if len(fall) == 0:
101102
assert not exc, (

0 commit comments

Comments
 (0)