Index: src/supervisor/options.py
===================================================================
--- src/supervisor/options.py	(revision 846)
+++ src/supervisor/options.py	(working copy)
@@ -13,7 +13,6 @@
 ##############################################################################
 
 import ConfigParser
-import asyncore
 import socket
 import getopt
 import os
@@ -34,6 +33,8 @@
 from fcntl import fcntl
 from fcntl import F_SETFL, F_GETFL
 
+from medusa import asyncore_25 as asyncore
+
 from supervisor.datatypes import boolean
 from supervisor.datatypes import integer
 from supervisor.datatypes import name_to_uid
Index: src/supervisor/tests/test_http.py
===================================================================
--- src/supervisor/tests/test_http.py	(revision 846)
+++ src/supervisor/tests/test_http.py	(working copy)
@@ -271,14 +271,20 @@
         self.assertEqual(authorizer.authorize(('foo', 'password')), True)
     
     def test_authorize_gooduser_badpassword_sha(self):
-        import sha
-        password = '{SHA}' + sha.new('password').hexdigest()
+        try:
+            from hashlib import sha1
+        except ImportError:
+            from sha import new as sha1
+        password = '{SHA}' + sha1('password').hexdigest()
         authorizer = self._makeOne({'foo':password})
         self.assertEqual(authorizer.authorize(('foo', 'bar')), False)
 
     def test_authorize_gooduser_goodpassword_sha(self):
-        import sha
-        password = '{SHA}' + sha.new('password').hexdigest()
+        try:
+            from hashlib import sha1
+        except ImportError:
+            from sha import new as sha1
+        password = '{SHA}' + sha1('password').hexdigest()
         authorizer = self._makeOne({'foo':password})
         self.assertEqual(authorizer.authorize(('foo', 'password')), True)
 
Index: src/supervisor/tests/test_supervisord.py
===================================================================
--- src/supervisor/tests/test_supervisord.py	(revision 846)
+++ src/supervisor/tests/test_supervisord.py	(working copy)
@@ -388,7 +388,7 @@
         process = DummyProcess(pconfig)
         gconfig = DummyPGroupConfig(options, pconfigs=[pconfig])
         pgroup = DummyProcessGroup(gconfig)
-        import asyncore
+        from medusa import asyncore_25 as asyncore
         exitnow = DummyDispatcher(readable=True, error=asyncore.ExitNow)
         pgroup.dispatchers = {6:exitnow}
         supervisord.process_groups = {'foo': pgroup}
@@ -408,7 +408,7 @@
             L.append(event)
         from supervisor import events
         events.subscribe(events.SupervisorStateChangeEvent, callback)
-        import asyncore
+        from medusa import asyncore_25 as asyncore
         options.test = True
         self.assertRaises(asyncore.ExitNow, supervisord.runforever)
         self.assertTrue(pgroup.all_stopped)
@@ -430,7 +430,7 @@
         supervisord.process_groups = {'foo': pgroup}
         supervisord.options.mood = 0
         supervisord.options.test = True
-        import asyncore
+        from medusa import asyncore_25 as asyncore
         self.assertRaises(asyncore.ExitNow, supervisord.runforever)
         self.assertEqual(pgroup.all_stopped, True)
 
Index: src/supervisor/http_client.py
===================================================================
--- src/supervisor/http_client.py	(revision 846)
+++ src/supervisor/http_client.py	(working copy)
@@ -2,11 +2,12 @@
 
 import sys
 import socket
-import asyncore
-import asynchat
 import base64
 from urlparse import urlparse
 
+from medusa import asyncore_25 as aysncore
+from medusa import asynchat_25 as asynchat
+
 CR="\x0d"
 LF="\x0a"
 CRLF=CR+LF
Index: src/supervisor/process.py
===================================================================
--- src/supervisor/process.py	(revision 846)
+++ src/supervisor/process.py	(working copy)
@@ -12,7 +12,6 @@
 #
 ##############################################################################
 
-import asyncore
 import os
 import sys
 import time
@@ -22,6 +21,8 @@
 import traceback
 import signal
 
+from medusa import asyncore_25 as asyncore
+
 from supervisor.states import ProcessStates
 from supervisor.states import SupervisorStates
 from supervisor.states import getProcessStateDescription
Index: src/supervisor/http.py
===================================================================
--- src/supervisor/http.py	(revision 846)
+++ src/supervisor/http.py	(working copy)
@@ -12,7 +12,6 @@
 #
 ##############################################################################
 
-import asyncore
 import os
 import stat
 import time
@@ -22,6 +21,7 @@
 import pwd
 import urllib
 
+from medusa import asyncore_25 as asyncore
 from medusa import http_date
 from medusa import http_server
 from medusa import producers
Index: src/supervisor/supervisorctl.py
===================================================================
--- src/supervisor/supervisorctl.py	(revision 846)
+++ src/supervisor/supervisorctl.py	(working copy)
@@ -39,11 +39,12 @@
 import getpass
 import xmlrpclib
 import socket
-import asyncore
 import errno
 import urlparse
 import threading
 
+from medusa import asyncore_25 as asyncore
+
 from supervisor.options import ClientOptions
 from supervisor.options import split_namespec
 from supervisor import xmlrpc
Index: src/supervisor/supervisord.py
===================================================================
--- src/supervisor/supervisord.py	(revision 846)
+++ src/supervisor/supervisord.py	(working copy)
@@ -46,8 +46,9 @@
 import errno
 import select
 import signal
-import asyncore
 
+from medusa import asyncore_25 as asyncore
+
 from supervisor.options import ServerOptions
 from supervisor.options import signame
 from supervisor import events

