bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)


Use `from ... import ...` to ensure module is fully loaded before accessing its attributes.
(cherry picked from commit 9017e0bd5e124ae6d2ed94b9e9cacb2e86270980)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 files changed