Explorar o código

Workaround to make the XMLRPC client usable on Windows. Closes #234

Lukas Rist %!s(int64=12) %!d(string=hai) anos
pai
achega
635e3e104f
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      supervisor/http.py

+ 6 - 2
supervisor/http.py

@@ -4,12 +4,16 @@ import time
 import sys
 import socket
 import errno
-import pwd
 import urllib
 
+try:
+    import pwd
+except ImportError:  # Windows
+    import getpass as pwd
+
 try:
     from hashlib import sha1
-except ImportError:
+except ImportError:  # Python 2.4 or earlier
     from sha import new as sha1
 
 from supervisor.medusa import asyncore_25 as asyncore