diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 15:05:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 16:15:47 +0000 |
commit | b686174b07bd56af4e5ffaa23c24f27f417fc305 (patch) | |
tree | 1ce335620d99341d94e88c159c0b9b0f6f0de5a0 /deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py | |
parent | Adding debian version 2.0.3-4. (diff) | |
download | deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.tar.xz deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.zip |
Merging upstream version 2.1.1 (Closes: #1026291).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py')
-rw-r--r-- | deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py | 10 |
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() |