diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-12-19 15:32:31 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-12-19 15:32:31 +0000 |
commit | 16ef52392c55341ae94edfca5e4feafe216844a4 (patch) | |
tree | c9c50bc9c97977393a6a99728627ebe735e1fe89 /lib | |
parent | 1b950f13d6e1d5b8b11ae5f5f85d403c0f05896e (diff) | |
download | sqlalchemy-16ef52392c55341ae94edfca5e4feafe216844a4.tar.gz |
more platform neutral way of getting at 'buffer'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqlalchemy/util.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index 1356fa324..3b787c954 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -49,11 +49,11 @@ else: except ImportError: import pickle -if py3k: - def buffer(x): - return x # no-op until we figure out what MySQLdb is going to use -else: - buffer = __builtin__.buffer +# a controversial feature, required by MySQLdb currently +def buffer(x): + return x + +buffer = getattr(__builtin__, 'buffer', buffer) if sys.version_info >= (2, 5): class PopulateDict(dict): |