mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Only AttributeError can be raised in this situation - on systems without
getuid or getpid. posix_getuid & posix_getpid never raise exceptions when called with no args.
This commit is contained in:
parent
3c4a629bdc
commit
91cc17d20e
1 changed files with 2 additions and 2 deletions
|
|
@ -116,11 +116,11 @@ def choose_boundary():
|
||||||
hostid = socket.gethostbyname(socket.gethostname())
|
hostid = socket.gethostbyname(socket.gethostname())
|
||||||
try:
|
try:
|
||||||
uid = `os.getuid()`
|
uid = `os.getuid()`
|
||||||
except:
|
except AttributeError:
|
||||||
uid = '1'
|
uid = '1'
|
||||||
try:
|
try:
|
||||||
pid = `os.getpid()`
|
pid = `os.getpid()`
|
||||||
except:
|
except AttributeError:
|
||||||
pid = '1'
|
pid = '1'
|
||||||
_prefix = hostid + '.' + uid + '.' + pid
|
_prefix = hostid + '.' + uid + '.' + pid
|
||||||
timestamp = '%.3f' % time.time()
|
timestamp = '%.3f' % time.time()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue