Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-74185: repr() of ImportError now contains attributes name and path.#1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Changes fromall commits
025c980
318a5d8
b2d33e8
60cde7b
dcaccba
9b5d0dc
57f5024
918b68d
e9294a2
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1954,6 +1954,36 @@ def test_non_str_argument(self): | ||
exc = ImportError(arg) | ||
self.assertEqual(str(arg), str(exc)) | ||
def test_repr(self): | ||
exc = ImportError() | ||
self.assertEqual(repr(exc), "ImportError()") | ||
exc = ImportError('test') | ||
self.assertEqual(repr(exc), "ImportError('test')") | ||
exc = ImportError('test', 'case') | ||
self.assertEqual(repr(exc), "ImportError('test', 'case')") | ||
exc = ImportError(name='somemodule') | ||
self.assertEqual(repr(exc), "ImportError(name='somemodule')") | ||
exc = ImportError('test', name='somemodule') | ||
self.assertEqual(repr(exc), "ImportError('test', name='somemodule')") | ||
exc = ImportError(path='somepath') | ||
self.assertEqual(repr(exc), "ImportError(path='somepath')") | ||
exc = ImportError('test', path='somepath') | ||
self.assertEqual(repr(exc), "ImportError('test', path='somepath')") | ||
exc = ImportError(name='somename', path='somepath') | ||
self.assertEqual(repr(exc), | ||
"ImportError(name='somename', path='somepath')") | ||
exc = ImportError('test', name='somename', path='somepath') | ||
self.assertEqual(repr(exc), | ||
"ImportError('test', name='somename', path='somepath')") | ||
Member
| ||
def test_copy_pickle(self): | ||
for kwargs in (dict(), | ||
dict(name='somename'), | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:meth:`repr` of :class:`ImportError` now contains attributes name and path. | ||
Patch by Serhiy Storchaka. |