mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 17:02:12 -05:00
merge with stable
This commit is contained in:
commit
d165644ce4
2 files changed
+5
-3
No files matched your search
@@ -16,7 +16,7 @@ import sys
|
||||
inspect = __import__('inspect')
|
||||
|
||||
from sphinx.util import force_decode
|
||||
from sphinx.util.pycompat import bytes
|
||||
from sphinx.util.pycompat import bytes, builtins
|
||||
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
@@ -146,6 +146,6 @@ def is_builtin_class_method(obj, attr_name):
|
||||
classes = [c for c in inspect.getmro(obj) if attr_name in c.__dict__]
|
||||
cls = classes[0] if classes else object
|
||||
|
||||
if not hasattr(__builtins__, cls.__name__):
|
||||
if not hasattr(builtins, safe_getattr(cls, '__name__', '')):
|
||||
return False
|
||||
return getattr(__builtins__, cls.__name__) is cls
|
||||
return getattr(builtins, safe_getattr(cls, '__name__', '')) is cls
|
||||
@@ -48,6 +48,7 @@ if sys.version_info >= (3, 0):
|
||||
raise SyntaxError(err.msg, (filepath, lineno, offset, err.value))
|
||||
return unicode(tree)
|
||||
from itertools import zip_longest # Python 3 name
|
||||
import builtins
|
||||
|
||||
else:
|
||||
# Python 2
|
||||
@@ -71,6 +72,7 @@ else:
|
||||
sys_encoding = locale.getpreferredencoding()
|
||||
# use Python 3 name
|
||||
from itertools import izip_longest as zip_longest
|
||||
import __builtin__ as builtins
|
||||
|
||||
|
||||
def execfile_(filepath, _globals):
|
||||
|
||||
Reference in new issue
Block a user