summaryrefslogtreecommitdiff
path: root/docs/topics/python3.txt
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-09-02 12:06:32 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-09-03 07:34:45 -0500
commit115318051c092f6ca8240262bd8b17b9e56ab838 (patch)
treed3be5498ae182a0b84c4b87c6f0a1e3e8006ea18 /docs/topics/python3.txt
parent50012577f31da9e92613501508094651ed0b4943 (diff)
[1.6.x] Replaced "not PY3" by "PY2", new in six 1.4.0.
Conflicts: django/db/backends/oracle/base.py django/db/backends/sqlite3/base.py django/db/models/base.py Backport of 365c3e8b from master.
Diffstat (limited to 'docs/topics/python3.txt')
-rw-r--r--docs/topics/python3.txt10
1 files changed, 4 insertions, 6 deletions
diff --git a/docs/topics/python3.txt b/docs/topics/python3.txt
index 9a0438e9e5..8f2306962b 100644
--- a/docs/topics/python3.txt
+++ b/docs/topics/python3.txt
@@ -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.