mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-03 15:15:02 +03:00
Force string in Python3 to ascii convertion
This commit is contained in:
parent
54b61fd5a0
commit
205bed0277
@ -65,8 +65,8 @@ if PY3:
|
||||
"""Convert the bytes string to a ASCII string
|
||||
Usefull to remove accent (diacritics)"""
|
||||
if isinstance(s, binary_type):
|
||||
return s
|
||||
return s.encode('ascii', 'ignore')
|
||||
return s.decode()
|
||||
return s.encode('ascii', 'ignore').decode()
|
||||
|
||||
def listitems(d):
|
||||
return list(d.items())
|
||||
|
Loading…
Reference in New Issue
Block a user