summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/mimetools.py10
1 files changed, 8 insertions, 2 deletions
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 @@ def choose_boundary():
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())`