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):
- 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