biopython/biopython — pull request #249 by peterjc (2013-10-20 19:13:46+00:00)
Title: Imports under Python 2 and 3 using try/except instead of 2to3 imports fixer

This replaces for example:

import cPickle
...
s = cPickle.dumps(obj)

with:

try:
import cPickle as pickle # Only available on Python 2
except ImportError:
import pickle
...
s = pickle.dumps(obj)

which under Python 3 only would be written:

import pickle
...
s = pickle.dumps(obj)

The benefit of this is we can drop the 2to3 imports fixer, which together with other work brings us closer to a single codebase which can be used under both Python 2 and Python 3 without needing 2to3.