summaryrefslogtreecommitdiffstats
path: root/deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py')
-rw-r--r--deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py b/deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py
index ba410c2..b5fb181 100644
--- a/deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py
+++ b/deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Steve 'Tarka' Smith (tarka@internode.on.net)
#
@@ -7,8 +6,6 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
import gzip
import logging
import socket
@@ -23,14 +20,14 @@ class PGException(Exception):
# Incrementally reads PeerGuardian blocklists v1 and v2.
# See http://wiki.phoenixlabs.org/wiki/P2B_Format
-class PGReader(object):
+class PGReader:
def __init__(self, filename):
log.debug('PGReader loading: %s', filename)
try:
with gzip.open(filename, 'rb') as _file:
self.fd = _file
- except IOError:
+ except OSError:
log.debug('Blocklist: PGReader: Incorrect file type or list is corrupt')
# 4 bytes, should be 0xffffffff
@@ -65,8 +62,5 @@ class PGReader(object):
return (start, end)
- # Python 2 compatibility
- next = __next__
-
def close(self):
self.fd.close()