Skip to content

Commit

Permalink
Make refactor work with python3
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Aug 9, 2016
1 parent eb2ebad commit 02fa86d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion malcolm/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
DefaultStateMachine # noqa
from malcolm.core.syncfactory import SyncFactory # noqa
from malcolm.core.table import Table # noqa
import vmetas # noqa
7 changes: 5 additions & 2 deletions malcolm/core/serializable.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ def __iter__(self):

def __getitem__(self, item):
"""Dictionary access to endpoint data"""
return self._endpoint_data[item]
try:
return self._endpoint_data[item]
except (KeyError, TypeError):
raise KeyError(item)

def __getattr__(self, item):
"""Attr access to endpoint data, if not already in self"""
try:
return self._endpoint_data[item]
except KeyError:
except (KeyError, TypeError):
raise AttributeError(item)

def __setattr__(self, item, value):
Expand Down

0 comments on commit 02fa86d

Please sign in to comment.