]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Modifications for PyPy support from Alex Gaynor.
authorMichael Trier <mtrier@gmail.org>
Wed, 9 Mar 2011 04:40:59 +0000 (23:40 -0500)
committerMichael Trier <mtrier@gmail.org>
Wed, 9 Mar 2011 04:40:59 +0000 (23:40 -0500)
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/compat.py
test/lib/util.py

index 015cc43db807c384c4e947f7d054e2f3a8d76406..96026c952fc40f85379542f5c0408ece100a9bdd 100644 (file)
@@ -5,7 +5,7 @@
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
 from compat import callable, cmp, reduce, defaultdict, py25_dict, \
-    threading, py3k, jython, win32, set_types, buffer, pickle, \
+    threading, py3k, jython, pypy, win32, set_types, buffer, pickle, \
     update_wrapper, partial, md5_hex, decode_slice, dottedgetter
 
 from _collections import NamedTuple, ImmutableContainer, immutabledict, \
index 6b6051973fe801b347220c49d65a7acfdce05a09..5aea70f242966941ad0902dd2e54c1359ac54ccf 100644 (file)
@@ -19,6 +19,7 @@ except ImportError:
 
 py3k = getattr(sys, 'py3kwarning', False) or sys.version_info >= (3, 0)
 jython = sys.platform.startswith('java')
+pypy = hasattr(sys, 'pypy_version_info')
 win32 = sys.platform.startswith('win')
 
 if py3k:
index b512cf6b0a502df6101c43e28383635685f96a5f..2597148acfbac1cc9db482a5d3ac0edbe9268d8b 100644 (file)
@@ -1,4 +1,4 @@
-from sqlalchemy.util import jython, defaultdict, decorator
+from sqlalchemy.util import jython, pypy, defaultdict, decorator
 from sqlalchemy.util.compat import decimal
 
 import gc
@@ -16,7 +16,8 @@ if jython:
 
     # "lazy" gc, for VM's that don't GC on refcount == 0
     lazy_gc = gc_collect
-
+elif pypy:
+    lazy_gc = gc_collect = gc.collect
 else:
     # assume CPython - straight gc.collect, lazy_gc() is a pass
     gc_collect = gc.collect