Skip to content

Commit

Permalink
Merge pull request #80 from ventor-dev/Fix_deprecate_warnings
Browse files Browse the repository at this point in the history
[FIX] Fixed deprecated warnings. Improved max compatible version
  • Loading branch information
pedrobaeza committed Aug 15, 2022
2 parents ff9cfa7 + 4b53bf3 commit f9898b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion prestapyt/dict2xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

from __future__ import unicode_literals
from xml.dom.minidom import getDOMImplementation
from past.builtins import basestring
from builtins import str

# past.builtins generates deprecated warning (import imp)
try:
from __builtin__ import basestring
except ImportError:
from past.types import basestring


def _process(doc, tag, tag_value):
"""
Expand Down
11 changes: 8 additions & 3 deletions prestapyt/prestapyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
Questions, comments? guewen.baconnier@gmail.com
"""

from future.standard_library import install_aliases
install_aliases()
# install_aliases() makes sense only on python 2.x
# On Python 3.x it generates deprecated warning (import imp)
from future.utils import PY2
if PY2:
from future.standard_library import install_aliases
install_aliases()

from urllib.parse import urlencode

Expand Down Expand Up @@ -86,7 +90,8 @@ class PrestaShopWebService(object):
"""Interact with the PrestaShop WebService API, use XML for messages."""

MIN_COMPATIBLE_VERSION = '1.4.0.17'
MAX_COMPATIBLE_VERSION = '1.7.5.2'
# 4th version number is to avoid constant version changes
MAX_COMPATIBLE_VERSION = '1.7.8.999'

def __init__(self, api_url, api_key, debug=False, session=None,
verbose=False):
Expand Down

0 comments on commit f9898b4

Please sign in to comment.