[pygobject/pygobject-3-36] flake8: fix errors with new flake8 3.8.0
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/pygobject-3-36] flake8: fix errors with new flake8 3.8.0
- Date: Sat, 30 May 2020 18:02:57 +0000 (UTC)
commit 4500bec2894c534fa11190a45bd58c8f5de6dca9
Author: Christoph Reiter <reiter christoph gmail com>
Date: Sun May 17 23:01:11 2020 +0200
flake8: fix errors with new flake8 3.8.0
examples/demo/demos/printing.py | 4 ++--
tests/test_gobject.py | 8 ++++----
tests/test_gtk_template.py | 4 ++++
3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/examples/demo/demos/printing.py b/examples/demo/demos/printing.py
index 6e68037d..a87bd6fd 100644
--- a/examples/demo/demos/printing.py
+++ b/examples/demo/demos/printing.py
@@ -92,8 +92,8 @@ class PrintingApp:
file_path = print_data['filename']
if not os.path.isfile(file_path):
file_path = os.path.join('demos', file_path)
- if not os.path.isfile:
- raise Exception("file not found: " % (file_path, ))
+ if not os.path.isfile(file_path):
+ raise Exception("file not found: %s" % (file_path, ))
# in reality you should most likely not read the entire
# file into a buffer
diff --git a/tests/test_gobject.py b/tests/test_gobject.py
index bba12cb7..1e557de7 100644
--- a/tests/test_gobject.py
+++ b/tests/test_gobject.py
@@ -804,8 +804,8 @@ class TestGValue(unittest.TestCase):
def test_list_properties():
- def find_param(l, name):
- for param in l:
+ def find_param(props, name):
+ for param in props:
if param.name == name:
return param
return
@@ -822,8 +822,8 @@ def test_list_properties():
props = list_props(Gio.SimpleAction)
assert find_param(props, "enabled")
- def names(l):
- return [p.name for p in l]
+ def names(props):
+ return [p.name for p in props]
assert (set(names(list_props(Gio.Action))) <=
set(names(list_props(Gio.SimpleAction))))
diff --git a/tests/test_gtk_template.py b/tests/test_gtk_template.py
index db3c8d98..d6745495 100644
--- a/tests/test_gtk_template.py
+++ b/tests/test_gtk_template.py
@@ -599,6 +599,7 @@ def test_template_hierarchy():
</template>
</interface>
"""
+
@Gtk.Template(string=testlabel)
class TestLabel(Gtk.Label):
@@ -617,6 +618,7 @@ def test_template_hierarchy():
</template>
</interface>
"""
+
@Gtk.Template(string=testbox)
class TestBox(Gtk.Box):
@@ -643,6 +645,7 @@ def test_template_hierarchy():
</template>
</interface>
"""
+
@Gtk.Template(string=window)
class MyWindow(Gtk.Window):
@@ -672,6 +675,7 @@ def test_multiple_init_template_calls():
</template>
</interface>
"""
+
@Gtk.Template(string=xml)
class MyBox(Gtk.Box):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]