1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 14:56:14 +01:00

Mute pylint false-positive errors related to rpm

This commit is contained in:
Daniel Mach 2023-01-20 13:20:19 +01:00
parent 64aefffc87
commit 987db92f3b
2 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,7 @@ from .util.packagequery import PackageError
try:
# import as RPMError because the class "error" is too generic
# pylint: disable=E0611
from rpm import error as RPMError
except:
# if rpm-python isn't installed (we might be on a debian system):

View File

@ -19,6 +19,7 @@ class Checker:
import rpm
self.dbdir = mkdtemp(prefix='oscrpmdb')
self.imported = {}
# pylint: disable=E1101
rpm.addMacro('_dbpath', self.dbdir)
self.ts = rpm.TransactionSet()
self.ts.initDB()
@ -29,6 +30,7 @@ class Checker:
def readkeys(self, keys=None):
import rpm
keys = keys or []
# pylint: disable=E1101
rpm.addMacro('_dbpath', self.dbdir)
for key in keys:
try:
@ -40,6 +42,7 @@ class Checker:
raise KeyError('', "no key imported")
import rpm
# pylint: disable=E1101
rpm.delMacro("_dbpath")
# python is an idiot