This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jean_Abou_Samra
Recipients Jean_Abou_Samra
Date 2022-03-02.20:42:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646253740.47.0.0857433223872.issue46902@roundup.psfhosted.org>
In-reply-to
Content
See for example:

>>> from pygments.regexopt import regexopt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'regexopt' from 'pygments.regexopt' (/home/jean/repos/pygments/pygments/regexopt.py)
>>> from pygments.regexopt import regex_opt
>>> regexopt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'regexopt' is not defined. Did you mean: 'regex_opt'?

In Python 3.10, there is a nice helpful error message suggesting
how to correct the typo for NameError and AttributeError. Would
it be possible to have the same for ImportError with 'from import'?
History
Date User Action Args
2022-03-02 20:42:20Jean_Abou_Samrasetrecipients: + Jean_Abou_Samra
2022-03-02 20:42:20Jean_Abou_Samrasetmessageid: <1646253740.47.0.0857433223872.issue46902@roundup.psfhosted.org>
2022-03-02 20:42:20Jean_Abou_Samralinkissue46902 messages
2022-03-02 20:42:20Jean_Abou_Samracreate