From d6e218ab548318468394b697c2a9dbc6ad1674c6 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Thu, 20 Dec 2007 19:52:43 -0800 Subject: [PATCH] Disable the deprecation warning for the khashmir tests. Need to rewrite the khashmir main functions to use Deferreds or something. --- apt_dht_Khashmir/khashmir.py | 4 ++++ apt_dht_Khashmir/krpc.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apt_dht_Khashmir/khashmir.py b/apt_dht_Khashmir/khashmir.py index b253c38..bc6f835 100644 --- a/apt_dht_Khashmir/khashmir.py +++ b/apt_dht_Khashmir/khashmir.py @@ -1,6 +1,9 @@ ## Copyright 2002-2004 Andrew Loewenstern, All Rights Reserved # see LICENSE.txt for license information +import warnings +warnings.simplefilter("ignore", DeprecationWarning) + from time import time from random import randrange from sha import sha @@ -362,6 +365,7 @@ class SimpleTests(unittest.TestCase): 'KE_AGE': 3600, } def setUp(self): + krpc.KRPC.noisy = 0 d = self.DHT_DEFAULTS.copy() d['PORT'] = 4044 self.a = Khashmir(d) diff --git a/apt_dht_Khashmir/krpc.py b/apt_dht_Khashmir/krpc.py index 1458fc2..8910ac5 100644 --- a/apt_dht_Khashmir/krpc.py +++ b/apt_dht_Khashmir/krpc.py @@ -56,7 +56,7 @@ class hostbroker(protocol.DatagramProtocol): ## connection class KRPC: - noisy = 1 + noisy = 0 def __init__(self, addr, server, transport): self.transport = transport self.factory = server -- 2.39.5