Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91cc17d

Browse files
author
Skip Montanaro
committed
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.
1 parent 3c4a629 commit 91cc17d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/mimetools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ def choose_boundary():
116116
hostid = socket.gethostbyname(socket.gethostname())
117117
try:
118118
uid = `os.getuid()`
119-
except:
119+
except AttributeError:
120120
uid = '1'
121121
try:
122122
pid = `os.getpid()`
123-
except:
123+
except AttributeError:
124124
pid = '1'
125125
_prefix = hostid + '.' + uid + '.' + pid
126126
timestamp = '%.3f' % time.time()

0 commit comments

Comments
 (0)