diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-09-02 12:06:32 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-09-02 12:11:02 +0200 |
| commit | 365c3e8b73eab825a8ecd0cf8046e1a0824ccd45 (patch) | |
| tree | f22f78037da5fa34250851e1dace72c4b2e77e78 /docs/topics/python3.txt | |
| parent | 4292097078279226cb725c2921011fb14634b9af (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.txt | 10 |
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. |
