Patchwork D7878: sha1dc: use proper string functions on Python 2/3

login
register
mail settings
Submitter phabricator
Date Jan. 15, 2020, 1:17 p.m.
Message ID <7d5f146e4e6cd120db2cdf4705366be0@localhost.localdomain>
Download mbox | patch
Permalink /patch/44361/
State Not Applicable
Headers show

Comments

phabricator - Jan. 15, 2020, 1:17 p.m.
Closed by commit rHG29a110e2776e: sha1dc: use proper string functions on Python 2/3 (authored by indygreg).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7878?vs=19277&id=19289

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7878/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7878

AFFECTED FILES
  mercurial/thirdparty/sha1dc/cext.c

CHANGE DETAILS




To: indygreg, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/thirdparty/sha1dc/cext.c b/mercurial/thirdparty/sha1dc/cext.c
--- a/mercurial/thirdparty/sha1dc/cext.c
+++ b/mercurial/thirdparty/sha1dc/cext.c
@@ -95,7 +95,7 @@ 
 		hexhash[i * 2] = hexdigit[hash[i] >> 4];
 		hexhash[i * 2 + 1] = hexdigit[hash[i] & 15];
 	}
-	return PyString_FromStringAndSize(hexhash, 40);
+	return PY23(PyString_FromStringAndSize, PyUnicode_FromStringAndSize)(hexhash, 40);
 }
 
 static PyTypeObject sha1ctxType;