You mean
```
if PY2:
   # python2 specific code
else:
   # python3 specific code
```
?

Because there is no PY constant.
[sky@localhost django]$ grep -R "PY =" django/*
[sky@localhost django]$ grep -R "PY3 =" django/*
django/utils/six.py:PY3 = sys.version_info[0] == 3
[sky@localhost django]$ grep -R "PY2 =" django/*
django/utils/six.py:PY2 = sys.version_info[0] == 2