Skip to content

Commit

Permalink
frontend/db/backends/afe/base.py: Fix pylint complaint
Browse files Browse the repository at this point in the history
pylint reveals:

************* Module frontend.db.backends.afe.base
E0203: 28:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35
E0203: 29:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35
E0203: 31:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35
E0203: 34:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35

Turns out that we do reference self.connection (in fact
defined on base classes), but for pylint this attribute
is not defined (machines that run pylint checks might
not have mysql-python installed). After checking the
code of the base classes, we verify that during init
self.connection is initialized with None anyway, so with
this change we silence yet another pylint complaint
(and since it's called before the base classes init
method, they'll take care of setting it to something
useful anyway).

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
  • Loading branch information
lmr committed Oct 3, 2012
1 parent b3f72b4 commit c42c7e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontend/db/backends/afe/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DatabaseOperations(MySQLOperations):

class DatabaseWrapper(MySQLDatabaseWrapper):
def __init__(self, *args, **kwargs):
self.connection = None
super(DatabaseWrapper, self).__init__(*args, **kwargs)
self.creation = MySQLCreation(self)
try:
Expand Down

0 comments on commit c42c7e9

Please sign in to comment.