diff options
author | Raymond Hettinger <python@rcn.com> | 2016-12-27 09:07:13 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-12-27 09:07:13 (GMT) |
commit | f45e858c60cf38a988749b8ce863cb3f171782d0 (patch) | |
tree | 38e2721806e7cd021cfa7c5f207d3b6835a94a46 | |
parent | 426b140fc57f2c8f6b0af778736751165386a7ef (diff) | |
parent | bb2839b680b565f99e463921f3c28fb3c7368096 (diff) | |
download | cpython-f45e858c60cf38a988749b8ce863cb3f171782d0.zip cpython-f45e858c60cf38a988749b8ce863cb3f171782d0.tar.gz cpython-f45e858c60cf38a988749b8ce863cb3f171782d0.tar.bz2 |
merge
-rw-r--r-- | Lib/random.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py index 49b0f14..ad1c916 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -254,7 +254,7 @@ class Random(_random.Random): try: i = self._randbelow(len(seq)) except ValueError: - raise IndexError('Cannot choose from an empty sequence') + raise IndexError('Cannot choose from an empty sequence') from None return seq[i] def shuffle(self, x, random=None): @@ -714,6 +714,9 @@ Library - Issue 28923: Remove editor artifacts from Tix.py. +- Issue #29055: Neaten-up empty population error on random.choice() + by suppressing the upstream exception. + - Issue #28871: Fixed a crash when deallocate deep ElementTree. - Issue #19542: Fix bugs in WeakValueDictionary.setdefault() and |