Package: hplip / 3.22.10+dfsg0-2

0032-Make-base.g.xint-more-generous-in-what-it-can-take.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Didier Raboud <odyx@debian.org>
Date: Tue, 6 Nov 2018 17:57:40 +0100
Subject: Make base.g.xint more generous in what it can take

Fixes hp-doctor in python with version '2.7.15+'

Closes: #912765
---
 base/g.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/g.py b/base/g.py
index f73e23f..15e67fc 100644
--- a/base/g.py
+++ b/base/g.py
@@ -326,9 +326,9 @@ def cleanup_spinner():
 # Convert string to int and return a list.
 def xint(ver):
     try:
-        l = [int(x) for x in ver.split('.')]
-    except:
-        pass
+        l = [int(x.translate(None, '+~')) for x in ver.split('.')]
+    except ValueError:
+        l = []
     return l
 
 # In case of import failure of extension modules, check whether its a mixed python environment issue.