]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Only AttributeError can be raised in this situation - on systems without
authorSkip Montanaro <skip@pobox.com>
Sat, 23 Mar 2002 05:58:52 +0000 (05:58 +0000)
committerSkip Montanaro <skip@pobox.com>
Sat, 23 Mar 2002 05:58:52 +0000 (05:58 +0000)
getuid or getpid.  posix_getuid & posix_getpid never raise exceptions when
called with no args.

Lib/mimetools.py

index 7cf8ad672e023c9ecfc057c23bcdaad826070b11..eb0ab713109cf9bc4b0c3f081aec00ca5e636cbd 100644 (file)
@@ -116,11 +116,11 @@ def choose_boundary():
         hostid = socket.gethostbyname(socket.gethostname())
         try:
             uid = `os.getuid()`
-        except:
+        except AttributeError:
             uid = '1'
         try:
             pid = `os.getpid()`
-        except:
+        except AttributeError:
             pid = '1'
         _prefix = hostid + '.' + uid + '.' + pid
     timestamp = '%.3f' % time.time()