R. David Murray <rdmur...@bitdance.com> added the comment: Thank you very much for those tests. I think you can simplify them a bit. For example, you can use assertRaises. You also might be able to use the test_support.temp_cwd context manager in your context manager, even though you don't need the cwd part.
I've attached an alternate, simpler patch to fix this bug, based on a similar fix I did in pydoc. The disadvantage of my patch is that it contains a hardcoding of the name of the function doing the import. I think this is acceptable given the much greater simplicity of my patch. I may be missing some subtlety, though, that the twisted folks know about. Or perhaps people will just find the hardcoding itself objectionable. ---------- Added file: http://bugs.python.org/file16829/alternate_import_fix.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7559> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com