1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-16 20:59:12 +03:00

python compat: remove text_type

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Douglas Bagnall
2020-07-04 14:27:06 +12:00
committed by Noel Power
parent ace5038031
commit f0860de5bb
19 changed files with 21 additions and 39 deletions

View File

@ -38,7 +38,6 @@ import time
import re
from samba.kcc import KCC, ldif_import_export
from samba.kcc.kcc_utils import KCCError
from samba.compat import text_type
from samba.uptodateness import (
get_partition_maps,
get_partition,
@ -198,7 +197,7 @@ def colour_hash(x):
given object."""
from hashlib import md5
tmp_str = str(x)
if isinstance(tmp_str, text_type):
if isinstance(tmp_str, str):
tmp_str = tmp_str.encode('utf8')
c = int(md5(tmp_str).hexdigest()[:6], base=16) & 0x7f7f7f
return '#%06x' % c