if method is None or not getattr(method, "exposed", False):
raise AssertionError("method does not exist")
- session.clear()
+ try:
+ session.expunge_all()
+ except AttributeError: # SQLAlchemy < 0.5.1
+ session.clear()
# Call the method, convert it into a 1-element tuple
# as expected by dumps
response = method(*params)