diff --git a/lib/entropy/const.py b/lib/entropy/const.py index 50ba91e03..ee53d4c3c 100644 --- a/lib/entropy/const.py +++ b/lib/entropy/const.py @@ -1439,20 +1439,14 @@ def const_isfileobj(obj): """ Return whether obj is a file object """ - if const_is_python3(): - import io - return isinstance(obj, io.IOBase) - else: - return isinstance(obj, file) + import io + return isinstance(obj, io.IOBase) def const_isnumber(obj): """ Return whether obj is an int, long object. """ - if const_is_python3(): - return isinstance(obj, int) - else: - return isinstance(obj, (int, long,)) + return isinstance(obj, int) def const_cmp(a, b): """ @@ -1575,12 +1569,9 @@ def const_debug_write(identifier, msg, force = False, stdout=None): teal(repr(current_thread.daemon)), darkgreen(repr(time.time())), darkred(identifier),) with _DEBUG_W_LOCK: - if const_is_python3(): - stdout.buffer.write( - const_convert_to_rawstring(th_identifier) + \ - b" " + const_convert_to_rawstring(msg) + b"\n") - else: - stdout.write("%s: %s" % (th_identifier, msg + "\n")) + stdout.buffer.write( + const_convert_to_rawstring(th_identifier) + \ + b" " + const_convert_to_rawstring(msg) + b"\n") stdout.flush() def const_get_caller(): diff --git a/rigo/rigo/utils.py b/rigo/rigo/utils.py index cf7e735b2..dcfe6cfab 100644 --- a/rigo/rigo/utils.py +++ b/rigo/rigo/utils.py @@ -204,9 +204,4 @@ def prepare_markup(text): """ Convert text to raw bytestring to make GTK3 happy. """ - return text # str()-strings just work - if const_isunicode(text): - return \ - const_convert_to_rawstring( - text, from_enctype=etpConst['conf_encoding']) return text