summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/_weakrefset.py6
-rwxr-xr-xLib/pydoc.py2
-rw-r--r--Lib/test/test_weakset.py3
-rw-r--r--Lib/urllib/parse.py2
4 files changed, 9 insertions, 4 deletions
diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py
index 3de3bda..4265369 100644
--- a/Lib/_weakrefset.py
+++ b/Lib/_weakrefset.py
@@ -66,7 +66,11 @@ class WeakSet:
return sum(x() is not None for x in self.data)
def __contains__(self, item):
- return ref(item) in self.data
+ try:
+ wr = ref(item)
+ except TypeError:
+ return False
+ return wr in self.data
def __reduce__(self):
return (self.__class__, (list(self),),
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 916076a..36c6a97 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1110,7 +1110,7 @@ doubt, consult the module reference at the location listed above.
result = result + self.section('FILE', file)
return result
- def docclass(self, object, name=None, mod=None):
+ def docclass(self, object, name=None, mod=None, *ignored):
"""Produce text documentation for a given class object."""
realname = object.__name__
name = name or realname
diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py
index 4e0aa38..e587898 100644
--- a/Lib/test/test_weakset.py
+++ b/Lib/test/test_weakset.py
@@ -50,7 +50,8 @@ class TestWeakSet(unittest.TestCase):
def test_contains(self):
for c in self.letters:
self.assertEqual(c in self.s, c in self.d)
- self.assertRaises(TypeError, self.s.__contains__, [[]])
+ # 1 is not weakref'able, but that TypeError is caught by __contains__
+ self.assertNotIn(1, self.s)
self.assertTrue(self.obj in self.fs)
del self.obj
self.assertTrue(ustr('F') not in self.fs)
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index e8e9cc7..b3494fa 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -8,7 +8,7 @@ and L. Masinter, January 2005.
RFC 2396: "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.
-RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zwinski, July 1998.
+RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998.
RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June
1995.