Skip to content

Commit 10aa7e2

Browse files
author
Sourcery AI
committed
'Refactored by Sourcery'
1 parent 8586074 commit 10aa7e2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

polyfactory/factories/base.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,7 @@ class Foo(ModelFactory[MyModel]): # <<< MyModel
237237
generic_args: Sequence[type[T]] = [
238238
arg for factory_base in factory_bases for arg in get_args(factory_base) if not isinstance(arg, TypeVar)
239239
]
240-
if len(generic_args) != 1:
241-
return None
242-
243-
return generic_args[0]
240+
return None if len(generic_args) != 1 else generic_args[0]
244241

245242
@classmethod
246243
def _get_sync_persistence(cls) -> SyncPersistenceProtocol[T]:

0 commit comments

Comments
 (0)