From: Stephen Finucane Date: Sun, 29 Nov 2015 06:51:14 +0000 (+0000) Subject: py3: max does not accept 'None' X-Git-Tag: v1.1.0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4db36325602951f7b34f93ba0d1920dda4f72d9c;p=thirdparty%2Fpatchwork.git py3: max does not accept 'None' max(n, None), where n is a valid number, is valid in Python 2 but not Python 3. Replace these calls with something that works in both versions of Python. Signed-off-by: Stephen Finucane --- diff --git a/patchwork/views/xmlrpc.py b/patchwork/views/xmlrpc.py index 64909e24..4f8fa6f7 100644 --- a/patchwork/views/xmlrpc.py +++ b/patchwork/views/xmlrpc.py @@ -278,8 +278,8 @@ def patch_to_dict(obj): 'submitter': six.text_type(obj.submitter).encode('utf-8'), 'submitter_id': obj.submitter_id, 'delegate': six.text_type(obj.delegate).encode('utf-8'), - 'delegate_id': max(obj.delegate_id, 0), - 'commit_ref': max(obj.commit_ref, ''), + 'delegate_id': obj.delegate_id or 0, + 'commit_ref': obj.commit_ref or '', }