asottile / pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
MIT License
3.58k stars 182 forks source link

Check for "import imp" and replace with import importlib as imp? #921

Closed jkary closed 11 months ago

jkary commented 11 months ago

Hi Anthony,

Came across this in a repo (trex) I'm trying to get python to work with python 3.12. The quick fix is shown above, but a proper fix likely would replace all imp.XXX with importlib.XXX.

Hope this helps! Jason

asottile commented 11 months ago

they are not equivalent