From: Mike Bayer Date: Thu, 18 Apr 2013 19:45:15 +0000 (-0400) Subject: python2.5 fix X-Git-Tag: rel_0_8_1~13^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=835f0abb59c10c1204884df1a19f088cf55d49d7;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git python2.5 fix --- diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 91e4f97361..408b119a07 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -3,9 +3,10 @@ # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php - """Provides the Session class and related utilities.""" +from __future__ import with_statement + import weakref from .. import util, sql, engine, exc as sa_exc, event from ..sql import util as sql_util, expression diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index 0f0a2f6742..033a87cc7b 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -153,9 +153,8 @@ if py3k: exc_type, exc_value, exc_tb = exc_info reraise(type(exception), exception, tb=exc_tb, cause=exc_value) else: - exec("""def reraise(tp, value, tb=None, cause=None): - raise tp, value, tb - """) + exec("def reraise(tp, value, tb=None, cause=None):\n" + " raise tp, value, tb\n") def raise_from_cause(exception, exc_info): # not as nice as that of Py3K, but at least preserves