Commit dc6369bb authored by Guido van Rossum's avatar Guido van Rossum

Don't die when getuid() or getpid() aren't defined.

parent 3fc4eb53
...@@ -106,8 +106,14 @@ def choose_boundary(): ...@@ -106,8 +106,14 @@ def choose_boundary():
import socket import socket
import os import os
hostid = socket.gethostbyname(socket.gethostname()) hostid = socket.gethostbyname(socket.gethostname())
uid = `os.getuid()` try:
pid = `os.getpid()` uid = `os.getuid()`
except:
uid = '1'
try:
pid = `os.getpid()`
except:
pid = '1'
seed = `rand.rand()` seed = `rand.rand()`
_prefix = hostid + '.' + uid + '.' + pid _prefix = hostid + '.' + uid + '.' + pid
timestamp = `int(time.time())` timestamp = `int(time.time())`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment