[1.6.x] Fixed #21443 -- Cannot show debug info on PY3's importlib

Thanks productions@zaziork.co.uk for the review.
Backport of 18185724e6 from master.