Skip to content

Commit

Permalink
remove leftover bits of Python2 support (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste authored Dec 13, 2023
1 parent a25ff00 commit eb4e47c
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 32 deletions.
6 changes: 1 addition & 5 deletions apprise/plugins/NotifyBoxcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@
from time import time
from hashlib import sha1
from itertools import chain
try:
from urlparse import urlparse

except ImportError:
from urllib.parse import urlparse
from urllib.parse import urlparse

from .NotifyBase import NotifyBase
from ..URLBase import PrivacyMode
Expand Down
3 changes: 0 additions & 3 deletions apprise/plugins/NotifyDBus.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import absolute_import
from __future__ import print_function

import sys
from .NotifyBase import NotifyBase
from ..common import NotifyImageSize
Expand Down
3 changes: 0 additions & 3 deletions apprise/plugins/NotifyGnome.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import absolute_import
from __future__ import print_function

from .NotifyBase import NotifyBase
from ..common import NotifyImageSize
from ..common import NotifyType
Expand Down
3 changes: 0 additions & 3 deletions apprise/plugins/NotifyMacOSX.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import absolute_import
from __future__ import print_function

import platform
import subprocess
import os
Expand Down
3 changes: 0 additions & 3 deletions apprise/plugins/NotifyWindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import absolute_import
from __future__ import print_function

from time import sleep

from .NotifyBase import NotifyBase
Expand Down
1 change: 0 additions & 1 deletion test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function
import asyncio
import concurrent.futures
import re
Expand Down
1 change: 0 additions & 1 deletion test/test_apprise_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function
import re
from unittest import mock

Expand Down
1 change: 0 additions & 1 deletion test/test_apprise_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function
import sys
import pickle
from apprise import Apprise, AppriseAsset, AppriseLocale
Expand Down
1 change: 0 additions & 1 deletion test/test_apprise_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function
import re
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion test/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function
import sys
import pytest
from apprise import Apprise
Expand Down
1 change: 0 additions & 1 deletion test/test_escapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function
from json import loads
import requests
from unittest import mock
Expand Down
10 changes: 1 addition & 9 deletions test/test_plugin_custom_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# POSSIBILITY OF SUCH DAMAGE.

import os
import sys
import json
from unittest import mock

Expand Down Expand Up @@ -257,13 +256,6 @@ def test_notify_json_plugin_attachments(mock_post):
body='body', title='title', notify_type=NotifyType.INFO,
attach=path) is False

# Get a appropriate "builtin" module name for pythons 2/3.
if sys.version_info.major >= 3:
builtin_open_function = 'builtins.open'

else:
builtin_open_function = '__builtin__.open'

# Test Valid Attachment (load 3)
path = (
os.path.join(TEST_VAR_DIR, 'apprise-test.gif'),
Expand All @@ -275,7 +267,7 @@ def test_notify_json_plugin_attachments(mock_post):
# Return our good configuration
mock_post.side_effect = None
mock_post.return_value = okay_response
with mock.patch(builtin_open_function, side_effect=OSError()):
with mock.patch('builtins.open', side_effect=OSError()):
# We can't send the message we can't open the attachment for reading
assert obj.notify(
body='body', title='title', notify_type=NotifyType.INFO,
Expand Down

0 comments on commit eb4e47c

Please sign in to comment.