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 prescod2
Recipients prescod2
Date 2021-06-10.22:45:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623365159.13.0.132987664597.issue44386@roundup.psfhosted.org>
In-reply-to
Content
from importlib import util

mathmodule = util.find_spec("math")
math1 = util.module_from_spec(mathmodule)
print(math1.pi)

=====

$ python3.8 /tmp/foo.py 
3.141592653589793

$ python3.9 /tmp/foo.py 
Traceback (most recent call last):
  File "/tmp/foo.py", line 5, in <module>
    print(math1.pi)
AttributeError: module 'math' has no attribute 'pi'
History
Date User Action Args
2021-06-10 22:45:59prescod2setrecipients: + prescod2
2021-06-10 22:45:59prescod2setmessageid: <1623365159.13.0.132987664597.issue44386@roundup.psfhosted.org>
2021-06-10 22:45:59prescod2linkissue44386 messages
2021-06-10 22:45:59prescod2create