Skip to content

Commit

Permalink
fixing errors found by landscape.io
Browse files Browse the repository at this point in the history
  • Loading branch information
asmodehn committed Feb 13, 2018
1 parent 4bab7d8 commit efa44c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion pyros_msgs/opt_as_nested/ros_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
six_long,
Accepter, Sanitizer, Array, Any, MinMax, CodePoint,
TypeChecker,
TypeChecker,
typechecker_from_rosfield_type
)

Expand Down
5 changes: 3 additions & 2 deletions pyros_msgs/typecheck/typechecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, t):
self.t = t

def __call__(self, *args, **kwargs):
if kwargs and hasattr(self.t, __dict__): # if self.t is an (new-style) object, it specifies how to sanitize, ie it is a filter
if kwargs and hasattr(self.t, '__dict__'): # if self.t is an (new-style) object, it specifies how to sanitize, ie it is a filter
# TODO : is this actually useful / used ??
return self.t(**{
subk: subt.sanitizer(kwargs.get(subk))
Expand Down Expand Up @@ -462,7 +462,8 @@ def make_typechecker_from_prototype(inst, field_map=None):
elif t is list and len(t) >1:
subt = type(inst[0]) # getting the type of the first element
return TypeChecker(Array(Sanitizer(subt)), Array(Accepter(t)))
elif hasattr(t, __dict__): # composed type with dict
elif hasattr(t, '__dict__'): # composed type with dict
# TODO : check if this is actually used or even useful
# we need to recurse on dict keys that are not builtin
members = {
f: field_map(type(ft))
Expand Down

0 comments on commit efa44c8

Please sign in to comment.