From aaef8cdf70f122a5ad185ff868414d5f6546f600 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 2 Dec 2003 11:18:51 +0000 Subject: [PATCH] Webutilified. --- plugins/Python.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/Python.py b/plugins/Python.py index d067ec4bd..bf03c7550 100644 --- a/plugins/Python.py +++ b/plugins/Python.py @@ -45,7 +45,6 @@ import sys import math import random import string -import urllib2 # Stupid printing on import... from cStringIO import StringIO @@ -54,6 +53,7 @@ import this sys.stdout = sys.__stdout__ import utils +import webutils import ircutils import privmsgs import callbacks @@ -190,9 +190,7 @@ class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable): if not self.configurables.get('aspn-snarfer', channel=msg.args[0]): return url = match.group(0) - fd = urllib2.urlopen(url) - s = fd.read() - fd.close() + s = webutils.getUrl(url) resp = [] for r in self._searches: m = r.search(s)