Discussion:
[Python-3000-checkins] r65852 - python/branches/py3k/Lib/test/test_threading.py
benjamin.peterson
2008-08-19 14:32:56 UTC
Permalink
Author: benjamin.peterson
Date: Tue Aug 19 16:32:56 2008
New Revision: 65852

Log:
fix possible error

Modified:
python/branches/py3k/Lib/test/test_threading.py

Modified: python/branches/py3k/Lib/test/test_threading.py
==============================================================================
--- python/branches/py3k/Lib/test/test_threading.py (original)
+++ python/branches/py3k/Lib/test/test_threading.py Tue Aug 19 16:32:56 2008
@@ -329,7 +329,10 @@

t = threading.Thread()
with catch_warning() as w:
- del threading.__warningregistry__
+ try:
+ del threading.__warningregistry__
+ except AttributeError:
+ pass
msg = "isDaemon() is deprecated in favor of the " \
"Thread.daemon property"
check(t.isDaemon(), w, msg)
Brett Cannon
2008-08-19 18:38:26 UTC
Permalink
On Tue, Aug 19, 2008 at 7:32 AM, benjamin.peterson
Post by benjamin.peterson
Author: benjamin.peterson
Date: Tue Aug 19 16:32:56 2008
New Revision: 65852
fix possible error
python/branches/py3k/Lib/test/test_threading.py
Modified: python/branches/py3k/Lib/test/test_threading.py
==============================================================================
--- python/branches/py3k/Lib/test/test_threading.py (original)
+++ python/branches/py3k/Lib/test/test_threading.py Tue Aug 19 16:32:56 2008
@@ -329,7 +329,10 @@
t = threading.Thread()
- del threading.__warningregistry__
+ del threading.__warningregistry__
+ pass
msg = "isDaemon() is deprecated in favor of the " \
"Thread.daemon property"
check(t.isDaemon(), w, msg)
Isn't testing warnings fun? =)

-Brett
Benjamin Peterson
2008-08-19 18:47:48 UTC
Permalink
Post by Brett Cannon
Isn't testing warnings fun? =)
Infuriatingly so...
Post by Brett Cannon
-Brett
_______________________________________________
Python-3000-checkins mailing list
Python-3000-checkins at python.org
http://mail.python.org/mailman/listinfo/python-3000-checkins
--
Cheers,
Benjamin Peterson
"There's no place like 127.0.0.1."
Nick Coghlan
2008-08-20 09:24:39 UTC
Permalink
Post by Benjamin Peterson
Post by Brett Cannon
Isn't testing warnings fun? =)
Infuriatingly so...
Something I found interesting - the "multiple warnings" feature I
initially added to catch_warning() solely in response to an external
request, actually turned out to be necessary to test the Py3k warnings
for the __hash__ changes (since a single class definition can emit
multiple warnings).

Just think how hard this would all be if Brett hadn't added the original
version of that context manager :)

Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
Loading...