Permalink
Browse files

Fix pycodestyle violations

  • Loading branch information...
Georgeto committed Feb 11, 2019
1 parent bd15912 commit e18d42a0f54c4ec615e1231da1e9f84266a9672c
Showing with 5 additions and 1 deletion.
  1. +5 −1 sipa/model/pycroft/unserialize.py
@@ -26,8 +26,12 @@ def _maybe_setattr(cls, attrname, attr):
setattr(cls, attrname, attr)


NoneType = type(None)


def _is_optional(t):
return t.__origin__ is Union and len(t.__args__) == 2 and t.__args__[1] is type(None)
return getattr(t, '__origin__', None) is Union and \
len(t.__args__) == 2 and t.__args__[1] is NoneType


MAXDEPTH = 100

0 comments on commit e18d42a

Please sign in to comment.