summaryrefslogtreecommitdiff
blob: 4f981adedbb3fe3713eef6af1bcf58c9808de966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
https://bugs.gentoo.org/show_bug.cgi?id=262881

Index: Hellanzb/Growl.py
===================================================================
--- Hellanzb/Growl.py	(Revision 1094)
+++ Hellanzb/Growl.py	(Arbeitskopie)
@@ -7,7 +7,13 @@
 __contributors__ = "Ingmar J Stein (Growl Team)"
 
 import struct
-import md5
+
+# The md5 module has been deprecated as of Python 2.6.
+try:
+    from hashlib import md5
+except ImportError:
+    from md5 import md5
+
 from socket import AF_INET, SOCK_DGRAM, socket
 
 GROWL_UDP_PORT=9887
@@ -51,7 +57,7 @@
             self.data += encoded
         for default in self.defaults:
             self.data += struct.pack("B", default)
-        self.checksum = md5.new()
+        self.checksum = md5()
         self.checksum.update(self.data)
         if self.password:
             self.checksum.update(self.password)
@@ -89,7 +95,7 @@
         self.data += self.title
         self.data += self.description
         self.data += self.application
-        self.checksum = md5.new()
+        self.checksum = md5()
         self.checksum.update(self.data)
         if password:
             self.checksum.update(password)
Index: Hellanzb/Util.py
===================================================================
--- Hellanzb/Util.py	(Revision 1094)
+++ Hellanzb/Util.py	(Arbeitskopie)
@@ -28,9 +28,6 @@
 
 class FatalError(Exception):
     """ An error that will cause the program to exit """
-    def __init__(self, message):
-        self.args = [message]
-        self.message = message
 
 class EmptyForThisPool(Empty):
     """ The queue is empty in terms of our current serverPool, but there are still segments to
Index: Hellanzb/HellaXMLRPC/HtPasswdAuth.py
===================================================================
--- Hellanzb/HellaXMLRPC/HtPasswdAuth.py	(Revision 1094)
+++ Hellanzb/HellaXMLRPC/HtPasswdAuth.py	(Arbeitskopie)
@@ -8,7 +8,13 @@
 (c) Copyright 2005 Philip Jenvey
 [See end of file]
 """
-import md5
+
+# The md5 module has been deprecated as of Python 2.6.
+try:
+    from hashlib import md5
+except ImportError:
+    from md5 import md5
+
 from twisted.web import static
 from twisted.web.resource import Resource
 
@@ -70,7 +76,7 @@
         
         self.user = user
         
-        m = md5.new()
+        m = md5()
         m.update(password)
         del password
         self.passwordDigest = m.digest()
@@ -90,7 +96,7 @@
     def authenticateUser(self, request):
         username, password = request.getUser(), request.getPassword()
         
-        m = md5.new()
+        m = md5()
         m.update(password)
         
         authenticated = username == self.user and self.passwordDigest == m.digest()