Skip to content

Commit

Permalink
Issue #85: Remove Python 2.7 support on Amazon-dash v2.0.0 (fixed Pyt…
Browse files Browse the repository at this point in the history
…hon 3.4 support)
  • Loading branch information
Nekmo committed Sep 4, 2018
1 parent 46aa593 commit 0008fde
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions amazon_dash/_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

try:
from json import JSONDecodeError
except ImportError:
# Python<3.5 support
JSONDecodeError = ValueError
2 changes: 1 addition & 1 deletion amazon_dash/confirmations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from requests import RequestException

from amazon_dash.exceptions import InvalidConfig, ConfirmationError
from json import JSONDecodeError
from ._compat import JSONDecodeError

class ConfirmationBase(object):
name = None
Expand Down
2 changes: 1 addition & 1 deletion amazon_dash/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import copy
import subprocess
from json import JSONDecodeError
from ._compat import JSONDecodeError
from urllib.parse import urlparse

from requests import request, RequestException
Expand Down
1 change: 1 addition & 0 deletions amazon_dash/tests/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
try:
from mock import patch, Mock, mock_open
except ImportError:
# Python<3.6 support
from unittest.mock import patch, Mock, mock_open

0 comments on commit 0008fde

Please sign in to comment.