mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[Napoleon] Changes __unicode__ to conditionally use the "u" string literal to support Python 3.2 (which is still used by some users)
This commit is contained in:
parent
8ae43b9fd4
commit
4061e3244d
@ -14,6 +14,7 @@
|
||||
import collections
|
||||
import inspect
|
||||
import re
|
||||
import sys
|
||||
|
||||
from six import string_types
|
||||
from six.moves import range
|
||||
@ -162,7 +163,10 @@ class GoogleDocstring(UnicodeMixin):
|
||||
Unicode version of the docstring.
|
||||
|
||||
"""
|
||||
return u'\n'.join(self.lines())
|
||||
if sys.version_info[0] >= 3:
|
||||
return '\n'.join(self.lines())
|
||||
else:
|
||||
return u'\n'.join(self.lines())
|
||||
|
||||
def lines(self):
|
||||
"""Return the parsed lines of the docstring in reStructuredText format.
|
||||
|
Loading…
Reference in New Issue
Block a user