Skip to content

Commit

Permalink
improve error detection
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcooke committed Jun 3, 2013
1 parent 6090dee commit 5974c27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = 'https://github.com/andrewcooke/simple-enum',
packages = ['simplenum'],
package_dir = {'': 'src'},
version = '0.0.3',
version = '0.0.5',
description = 'A simpler Enum for Python 3',
author = 'Andrew Cooke',
author_email = 'andrew@acooke.org',
Expand Down
5 changes: 2 additions & 3 deletions src/simplenum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ class ExplicitError(Exception): pass

class Explode(int):

@classmethod
def __getattribute__(cls, item):
raise ExplicitError(ERR_MSG)
def __call__(self, *args, **kwargs): pass

def __call__(self, *args, **kwargs):
raise ExplicitError(ERR_MSG)

class ClassDict(OrderedDict):
'''
Expand Down
2 changes: 1 addition & 1 deletion src/simplenum/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Bad1(Enum):

with self.assertRaises(ExplicitError):
class Bad1(Enum):
a = sin(b)
a = sin(b) + 2

with self.assertRaises(ExplicitError):
class Bad1(Enum):
Expand Down

0 comments on commit 5974c27

Please sign in to comment.