mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
Make test_inspect pass once again.
This commit is contained in:
parent
2a857de62a
commit
813b0e5b6d
2 changed files with 3 additions and 2 deletions
|
|
@ -313,7 +313,7 @@ def getdoc(object):
|
||||||
doc = object.__doc__
|
doc = object.__doc__
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return None
|
return None
|
||||||
if not isinstance(doc, types.StringTypes):
|
if not isinstance(doc, basestring):
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
lines = doc.expandtabs().split('\n')
|
lines = doc.expandtabs().split('\n')
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import types
|
||||||
import unittest
|
import unittest
|
||||||
import inspect
|
import inspect
|
||||||
import datetime
|
import datetime
|
||||||
|
import collections
|
||||||
|
|
||||||
from test.test_support import TESTFN, run_unittest
|
from test.test_support import TESTFN, run_unittest
|
||||||
|
|
||||||
|
|
@ -60,7 +61,7 @@ class TestPredicates(IsTestBase):
|
||||||
self.istest(inspect.ismethod, 'git.argue')
|
self.istest(inspect.ismethod, 'git.argue')
|
||||||
self.istest(inspect.ismodule, 'mod')
|
self.istest(inspect.ismodule, 'mod')
|
||||||
self.istest(inspect.istraceback, 'tb')
|
self.istest(inspect.istraceback, 'tb')
|
||||||
self.istest(inspect.isdatadescriptor, '__builtin__.file.closed')
|
self.istest(inspect.isdatadescriptor, 'collections.defaultdict.default_factory')
|
||||||
if hasattr(types, 'GetSetDescriptorType'):
|
if hasattr(types, 'GetSetDescriptorType'):
|
||||||
self.istest(inspect.isgetsetdescriptor,
|
self.istest(inspect.isgetsetdescriptor,
|
||||||
'type(tb.tb_frame).f_locals')
|
'type(tb.tb_frame).f_locals')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue