Code sync
[external/hplip.git] / packaging / make-commafy-correctly-work-with-python-2.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## make-commafy-correctly-work-with-python-2.dpatch by  <till.kamppeter@gmail.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: No description.
6
7 @DPATCH@
8 diff -urNad hplip-3.10.2~/base/utils.py hplip-3.10.2/base/utils.py
9 --- hplip-3.10.2~/base/utils.py 2010-04-09 21:20:22.085486637 +0200
10 +++ hplip-3.10.2/base/utils.py  2010-04-09 21:22:19.865465070 +0200
11 @@ -362,7 +362,7 @@
12  
13  
14  def commafy(val):
15 -    return unicode(locale.format("%d", val, grouping=True))
16 +    return locale.format("%d", val, grouping=True).decode(locale.getpreferredencoding())
17  
18  
19  def format_bytes(s, show_bytes=False):