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-02 12:11:02 +0200
commit365c3e8b73eab825a8ecd0cf8046e1a0824ccd45 (patch)
treef22f78037da5fa34250851e1dace72c4b2e77e78 /docs/topics/python3.txt
parent4292097078279226cb725c2921011fb14634b9af (diff)
Replaced "not PY3" by "PY2", new in six 1.4.0.
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.