mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Replaced "not PY3" by "PY2", new in six 1.4.0.
This commit is contained in:
parent
4292097078
commit
365c3e8b73
27 changed files with 47 additions and 49 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue