Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Jan 9, 2024
1 parent 45c3e3e commit 84fdf9f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions polyfactory/factories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,7 @@ class Foo(ModelFactory[MyModel]): # <<< MyModel
generic_args: Sequence[type[T]] = [
arg for factory_base in factory_bases for arg in get_args(factory_base) if not isinstance(arg, TypeVar)
]
if len(generic_args) != 1:
return None

return generic_args[0]
return None if len(generic_args) != 1 else generic_args[0]

@classmethod
def _get_sync_persistence(cls) -> SyncPersistenceProtocol[T]:
Expand Down

0 comments on commit 84fdf9f

Please sign in to comment.