Skip to content

Commit 65ceb3a

Browse files
jrialatodorov
authored andcommitted
Fix: compatibility with Python < 3.6
ModuleNotFoundError is a subclass of ImportError, introduced in Python 3.6, and as such fails in lower Python versions. https://docs.python.org/3/library/exceptions.html#ModuleNotFoundError
1 parent c785380 commit 65ceb3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pylint_django/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def register(linter):
2828
try:
2929
from pylint_django.augmentations import apply_augmentations
3030
apply_augmentations(linter)
31-
except ModuleNotFoundError:
31+
except ImportError:
3232
# probably trying to execute pylint_django when Django isn't installed
3333
# in this case the django-not-installed checker will kick-in
3434
pass

0 commit comments

Comments
 (0)