Skip to content

Commit f252f0a

Browse files
committed
Issue DeprecationWarning when running on Python 2
1 parent 8bed358 commit f252f0a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Version 0.8.0 (unreleased)
44

5+
* This is the last version to support Python 2. Issues a deprecation warning!
56
* [#109](http://github.com/landscapeio/pylint-django/pull/109),
67
adding 'urlpatterns', 'register', 'app_name' to good names. Obsoletes
78
[#111](http://github.com/landscapeio/pylint-django/pull/111), fixes

pylint_django/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
"""pylint_django module."""
22
from __future__ import absolute_import
3+
4+
import sys
5+
import warnings
6+
37
from pylint_django import plugin
48

9+
if sys.version_info < (3, ):
10+
warnings.warn("Version 0.8.0 is the last to support Python 2. "
11+
"Please migrate to Python 3!", DeprecationWarning)
12+
513
register = plugin.register

0 commit comments

Comments
 (0)