diff options
Diffstat (limited to 'deluge/core/core.py')
-rw-r--r-- | deluge/core/core.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/deluge/core/core.py b/deluge/core/core.py index 881f0065d..acd3a0b47 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -8,8 +8,6 @@ # See LICENSE for more details. # -from __future__ import division, unicode_literals - import glob import logging import os @@ -17,8 +15,8 @@ import shutil import tempfile import threading from base64 import b64decode, b64encode +from urllib.request import URLError, urlopen -from six import string_types from twisted.internet import defer, reactor, task from twisted.web.client import Agent, readBody @@ -56,12 +54,6 @@ from deluge.event import ( ) from deluge.httpdownloader import download_file -try: - from urllib.request import URLError, urlopen -except ImportError: - # PY2 fallback - from urllib2 import URLError, urlopen - log = logging.getLogger(__name__) DEPR_SESSION_STATUS_KEYS = { @@ -666,7 +658,7 @@ class Core(component.Component): def pause_torrent(self, torrent_id): """Pauses a torrent""" log.debug('Pausing: %s', torrent_id) - if not isinstance(torrent_id, string_types): + if not isinstance(torrent_id, str): self.pause_torrents(torrent_id) else: self.torrentmanager[torrent_id].pause() @@ -717,7 +709,7 @@ class Core(component.Component): def resume_torrent(self, torrent_id): """Resumes a torrent""" log.debug('Resuming: %s', torrent_id) - if not isinstance(torrent_id, string_types): + if not isinstance(torrent_id, str): self.resume_torrents(torrent_id) else: self.torrentmanager[torrent_id].resume() @@ -901,7 +893,7 @@ class Core(component.Component): if 'owner' in options and not self.authmanager.has_account(options['owner']): raise DelugeError('Username "%s" is not known.' % options['owner']) - if isinstance(torrent_ids, string_types): + if isinstance(torrent_ids, str): torrent_ids = [torrent_ids] for torrent_id in torrent_ids: |