Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pycompat.py @ 43103:c95b2f40db7c
py3: stop normalizing 2nd argument of *attr() to unicode
Now that we don't byteify strings, we can stop normalizing the 2nd
string argument to getattr() and remove explicit overrides we were
using in the code base.
We no longer use some helper functions in the source transformer,
so we remove those as well.
Differential Revision: https://phab.mercurial-scm.org/D7012
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 06 Oct 2019 17:45:05 -0400 |
parents | 813aa8cc55d4 |
children | 74802979dd9d |
comparison
equal
deleted
inserted
replaced
43102:829088e87032 | 43103:c95b2f40db7c |
---|---|
268 raise exc.with_traceback(tb) | 268 raise exc.with_traceback(tb) |
269 | 269 |
270 def getdoc(obj): | 270 def getdoc(obj): |
271 """Get docstring as bytes; may be None so gettext() won't confuse it | 271 """Get docstring as bytes; may be None so gettext() won't confuse it |
272 with _('')""" | 272 with _('')""" |
273 doc = getattr(obj, u'__doc__', None) | 273 doc = getattr(obj, '__doc__', None) |
274 if doc is None: | 274 if doc is None: |
275 return doc | 275 return doc |
276 return sysbytes(doc) | 276 return sysbytes(doc) |
277 | 277 |
278 def _wrapattrfunc(f): | 278 def _wrapattrfunc(f): |