Skip to content

Commit

Permalink
Disable peewee version check for in _get_exception_wrapper() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
rudyryk committed Mar 5, 2017
1 parent 6c0880f commit 120b0c3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions peewee_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
logger = logging.getLogger('peewee.async')
logger.addHandler(logging.NullHandler())

PEEWEE_VERSION = tuple([int(x) for x in peewee.__version__.split('.')])

try:
import aiopg
except ImportError:
Expand Down Expand Up @@ -1484,10 +1482,10 @@ def _get_exception_wrapper(database):
"""Get peewee exceptions context manager for database
in backward compatible manner.
"""
if PEEWEE_VERSION <= (2, 8, 5):
return database.exception_wrapper()
else:
if isinstance(database.exception_wrapper, peewee.ExceptionWrapper):
return database.exception_wrapper
else:
return database.exception_wrapper()


@asyncio.coroutine
Expand Down

0 comments on commit 120b0c3

Please sign in to comment.