]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
python2.5 fix
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Apr 2013 19:45:15 +0000 (15:45 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Apr 2013 19:45:15 +0000 (15:45 -0400)
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/util/compat.py

index 91e4f9736112bc8c9f6ca9d65afc7ad4a61061a4..408b119a0701a108b549abc8eb12de5b141eb4ce 100644 (file)
@@ -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
index 0f0a2f6742dc613f707ffb9298ab0afa16190d50..033a87cc7bbf3f0c3f9ca0e749d72f7b000a6a59 100644 (file)
@@ -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