From 2c156d300068eddac659da4b0505cdbec0dc42fa Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 26 Mar 2019 01:20:18 -0400 Subject: [PATCH] test: fix broken netifaces check This will always return True on python2 [] > 1 On python3 it is instead an error, because you cannot compare a list to an int -- instead, we want to compare the length of the returned list, to see how many interfaces are available. --- src/calibre/test_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 45c85d1bf8..2ba6492114 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -254,7 +254,7 @@ class BuildTest(unittest.TestCase): def test_netifaces(self): import netifaces - self.assertGreaterEqual(netifaces.interfaces(), 1, 'netifaces could find no network interfaces') + self.assertGreaterEqual(len(netifaces.interfaces()), 1, 'netifaces could find no network interfaces') def test_psutil(self): import psutil