summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-12-27 09:06:52 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-12-27 09:06:52 (GMT)
commitbb2839b680b565f99e463921f3c28fb3c7368096 (patch)
tree66a9d9cfd4a82226a6ef907ae698eb93c8f95aa1 /Lib/random.py
parent246cbf23fa20e7d2533a4bc56ac1deb24d598521 (diff)
downloadcpython-bb2839b680b565f99e463921f3c28fb3c7368096.zip
cpython-bb2839b680b565f99e463921f3c28fb3c7368096.tar.gz
cpython-bb2839b680b565f99e463921f3c28fb3c7368096.tar.bz2
Issue #29055: Suppress upstream exception for random.choice()
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py2
1 files changed, 1 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):