Replaced "not PY3" by "PY2", new in six 1.4.0.

This commit is contained in:
Aymeric Augustin 2013-09-02 12:06:32 +02:00
parent 4292097078
commit 365c3e8b73
27 changed files with 47 additions and 49 deletions

View file

@ -376,15 +376,13 @@ explicitly tries both locations, as follows::
except ImportError: # Python 2
from urlparse import urlparse, urlunparse
PY3
PY2
~~~
If you need different code in Python 2 and Python 3, check :data:`six.PY3`::
If you need different code in Python 2 and Python 3, check :data:`six.PY2`::
if six.PY3:
# do stuff Python 3-wise
else:
# do stuff Python 2-wise
if six.PY2:
# compatibility code for Python 2
This is a last resort solution when :mod:`six` doesn't provide an appropriate
function.