We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b338ce commit d35efd8Copy full SHA for d35efd8
nipype2pydra/pkg_gen/__init__.py
@@ -7,6 +7,7 @@
7
import shutil
8
import string
9
from pathlib import Path
10
+import inspect
11
import attrs
12
from warnings import warn
13
import requests
@@ -481,9 +482,10 @@ def combine_types(type_, prev_type):
481
482
if ty.get_origin(type_) is list:
483
as_list = True
484
type_ = ty.get_args(type_)[0]
- if issubclass(type_, prev_type):
485
+ both_classes = inspect.isclass(type_) and inspect.isclass(prev_type)
486
+ if both_classes and issubclass(type_, prev_type):
487
combined = type_
- elif issubclass(prev_type, type_):
488
+ elif both_classes and issubclass(prev_type, type_):
489
combined = prev_type
490
else:
491
if ty.get_origin(prev_type) is ty.Union:
0 commit comments