Don't die when getuid() or getpid() aren't defined.
diff --git a/Lib/mimetools.py b/Lib/mimetools.py
index da33a77..baf9379 100644
--- a/Lib/mimetools.py
+++ b/Lib/mimetools.py
@@ -106,8 +106,14 @@
import socket
import os
hostid = socket.gethostbyname(socket.gethostname())
- uid = `os.getuid()`
- pid = `os.getpid()`
+ try:
+ uid = `os.getuid()`
+ except:
+ uid = '1'
+ try:
+ pid = `os.getpid()`
+ except:
+ pid = '1'
seed = `rand.rand()`
_prefix = hostid + '.' + uid + '.' + pid
timestamp = `int(time.time())`