File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
pylint_django/transforms/transforms Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 2727* Update tests and require latest version of pylint (>=1.8), fixes
2828 [ #53 ] ( https://github.com/landscapeio/pylint-django/issues/53 ) ,
2929 [ #97 ] ( https://github.com/landscapeio/pylint-django/issues/97 )
30+ * [ #81 ] ( https://github.com/landscapeio/pylint-django/issues/81 ) Fix 'duplicate-except' false negative
31+ for except blocks which catch the ` DoesNotExist ` exception.
3032
3133## Version 0.7.4
3234* [ #88 ] ( https://github.com/landscapeio/pylint-django/pull/88 ) Fixed builds with Django 1.10 (thanks to [ federicobond] ( https://github.com/federicobond ) )
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ class Model(object):
88 pk = None
99
1010 MultipleObjectsReturned = MultipleObjectsReturned
11- DoesNotExist = ObjectDoesNotExist
1211
1312 save = lambda * a , ** kw : None
1413 delete = lambda * a , ** kw : None
Original file line number Diff line number Diff line change 1+ """
2+ Checks that Pylint does not complain about duplicate
3+ except blocks catching DoesNotExist exceptions:
4+ https://github.com/landscapeio/pylint-django/issues/81
5+ """
6+ # pylint: disable=missing-docstring
7+ from django .db import models
8+
9+
10+ class Book (models .Model ):
11+ name = models .CharField (max_length = 100 )
12+
13+
14+ class Author (models .Model ):
15+ name = models .CharField (max_length = 100 )
16+
17+ def dummy_func ():
18+ try :
19+ print ("foo" )
20+ except Book .DoesNotExist :
21+ print ("bar" )
22+ except Author .DoesNotExist :
23+ print ("baz" )
You can’t perform that action at this time.
0 commit comments