Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Fixed deprecated warnings. Improved max compatible version #80

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

ventor-dev
Copy link

When working with the library, depricate warnings regularly appear:
/Users/okuryan/Development/15.0/venv/lib/python3.8/site-packages/future/standard_library/init.py:65: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

First one generated by the method install_aliases(). It make sense only on Python 3.xx because it monkey-patches the standard library in Python 2.xx to provide aliases for better Python 3.xx compatibility

Second one generated by past.builtins, becuse it imports past.builtins.misc module that imports imp

Also I suggest setting the lower digit version to 99. This will help to avoid constantly changing this value when a new version of PrestaShop is released

try:
from __builtin__ import basestring
except ImportError:
from past.types import basestring
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not past.builtins?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because past.builtins imports past.builtins.misc
image
and past.builtins.misc imports from imp
image
and imp has deprecated warning
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza are you ok with the above explanation?

prestapyt/prestapyt.py Outdated Show resolved Hide resolved
prestapyt/prestapyt.py Outdated Show resolved Hide resolved
@pedrobaeza
Copy link
Collaborator

Please squash both commits into one, or separate correctly each change (deprecated warnings vs max compatible version).

@ventor-dev
Copy link
Author

ventor-dev commented Aug 15, 2022

I made one commit

@pedrobaeza pedrobaeza merged commit f9898b4 into prestapyt:master Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants