brettlangdon / importhook

Python package for executing functions when packages are imported
https://brettlangdon.github.io/importhook/
MIT License
25 stars 3 forks source link

Python version #1

Closed Nivekiba closed 4 years ago

Nivekiba commented 4 years ago

Hello @brettlangdon , i'm working with python 2 and your module is giving out some errors

while in python 3 there are no errors

brettlangdon commented 4 years ago

@Nivekiba would you be willing to share the errors you are seeing with an example of how you are using the library?

Nivekiba commented 4 years ago

After typing python -i intercept.py (python)

i got the following errors:

image

In the intercept.py it's just a simple print function

Nivekiba commented 4 years ago

image

This is the other error i'm getting

brettlangdon commented 4 years ago

I just released 1.0.7, please give that a try and let me know if the issue still exists.

The problem is because I was using f-strings for logging instead of ''.format()

I'd prefer to maintain this library only for Python 3, but this is an easy enough change to get this working.

Nivekiba commented 4 years ago

And for the errors on importlib.abc ? Is there anyway to avoid that ?

brettlangdon commented 4 years ago

yeah, I am going to update this package so it won't install on Python 2, that was my original intention anyways.

I am sorry about any confusion here, I put the package metadata as Python 3 only, but I should have done python_requires=">3.3".

I am only interested in maintaining this package for Python 3 since Python 2 is now EOL.