Skip to content

Commit 95ff89d

Browse files
committed
cosalib: silence pylint E1120 for GI methods
pylint is treating GObject-introspected methods (from gi.repository) as unbound instance methods that require a self argument, even though at runtime these calls are valid and work as expected. This causes false positive E1120 (no-value-for-parameter) errors on calls such as RpmOstree.get_basearch() and Json.Generator.new(). Add disable comments to the affected GI calls to keep pylint from complaining while preserving the existing behavior.
1 parent 3c59509 commit 95ff89d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/cmd-basearch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
import gi
55
gi.require_version("RpmOstree", "1.0")
66
from gi.repository import RpmOstree
7-
print(RpmOstree.get_basearch())
7+
print(RpmOstree.get_basearch()) # pylint: disable=E1120

src/commitmeta_to_json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ commitmeta = commit.get_child_value(0)
2525
if sys.byteorder != 'big':
2626
commitmeta = commitmeta.byteswap()
2727

28-
g = Json.Generator.new()
28+
g = Json.Generator.new() # pylint: disable=E1120
2929
g.set_root(Json.gvariant_serialize(commitmeta))
3030
stdout = Gio.UnixOutputStream.new(sys.stdout.fileno(), False)
3131
g.set_pretty(True)

src/cosalib/cmdlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def get_basearch():
409409
try:
410410
return get_basearch.saved
411411
except AttributeError:
412-
get_basearch.saved = RpmOstree.get_basearch()
412+
get_basearch.saved = RpmOstree.get_basearch() # pylint: disable=E1120
413413
return get_basearch.saved
414414

415415

0 commit comments

Comments
 (0)