Submitter | Katsunori FUJIWARA |
---|---|
Date | Aug. 15, 2017, 4:19 p.m. |
Message ID | <17bdacaa47c5b08ebe4e.1502813941@speaknoevil> |
Download | mbox | patch |
Permalink | /patch/23018/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/i18n/hggettext b/i18n/hggettext --- a/i18n/hggettext +++ b/i18n/hggettext @@ -122,9 +122,14 @@ def docstrings(path): name = "%s.%s" % (actualpath, func.__name__) lineno = inspect.getsourcelines(func)[1] doc = func.__doc__ + origdoc = getattr(func, '_origdoc', '') if rstrip: doc = doc.rstrip() - lineno += offset(src, doc, name, 1) + origdoc = origdoc.rstrip() + if origdoc: + lineno += offset(src, origdoc, name, 1) + else: + lineno += offset(src, doc, name, 1) print(poentry(actualpath, lineno, doc))