# HG changeset patch # User RhodeCode Admin # Date 2023-03-06 22:44:55 # Node ID 46ff414cdefe983535eea3753407deb9adb4af51 # Parent f88262ff3c3d01d48536277cc78192ae80ee8fe1 py3: 2to3 fixes diff --git a/rhodecode/config/settings_maker.py b/rhodecode/config/settings_maker.py --- a/rhodecode/config/settings_maker.py +++ b/rhodecode/config/settings_maker.py @@ -58,7 +58,7 @@ def aslist(obj, sep=None, strip=True): :param sep: :param strip: """ - if isinstance(obj, (str,)): + if isinstance(obj, str): if obj in ['', ""]: return [] @@ -81,7 +81,7 @@ class SettingsMaker(object): @classmethod def _bool_func(cls, input_val): - if isinstance(input_val, unicode): + if isinstance(input_val, str): input_val = input_val.encode('utf8') return str2bool(input_val) diff --git a/rhodecode/lib/diffs.py b/rhodecode/lib/diffs.py --- a/rhodecode/lib/diffs.py +++ b/rhodecode/lib/diffs.py @@ -291,7 +291,7 @@ class DiffProcessor(object): for chunk in self._diff.chunks(): head = chunk.header - diff = imap(self._escaper, self.diff_splitter(chunk.diff)) + diff = map(self._escaper, self.diff_splitter(chunk.diff)) raw_diff = chunk.raw limited_diff = False exceeds_limit = False @@ -403,7 +403,7 @@ class DiffProcessor(object): 'new_lineno': '', 'action': Action.CONTEXT, 'line': msg, - } for _op, msg in stats['ops'].iteritems() + } for _op, msg in stats['ops'].items() if _op not in [MOD_FILENODE]]) _files.append({ @@ -600,7 +600,7 @@ class DiffProcessor(object): 'new_lineno': '', 'action': Action.CONTEXT, 'line': msg, - } for _op, msg in stats['ops'].iteritems() + } for _op, msg in stats['ops'].items() if _op not in [MOD_FILENODE]]) original_filename = safe_unicode(head['a_path']) diff --git a/rhodecode/lib/hooks_daemon.py b/rhodecode/lib/hooks_daemon.py --- a/rhodecode/lib/hooks_daemon.py +++ b/rhodecode/lib/hooks_daemon.py @@ -27,8 +27,8 @@ import threading import socket import msgpack -from BaseHTTPServer import BaseHTTPRequestHandler -from SocketServer import TCPServer +from http.server import BaseHTTPRequestHandler +from socketserver import TCPServer import rhodecode from rhodecode.lib.exceptions import HTTPLockedRC, HTTPBranchProtected