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 Dec 13, 2023
1 parent bc0ada7 commit add8ed6
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 @@ -237,10 +237,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 add8ed6

Please sign in to comment.