# 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, \
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:
-from sqlalchemy.util import jython, defaultdict, decorator
+from sqlalchemy.util import jython, pypy, defaultdict, decorator
from sqlalchemy.util.compat import decimal
import gc
# "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