[Python-checkins] cpython (merge 3.5 -> default): Issue #19164: Improve exception message of uuid.UUID()

berker.peksag python-checkins at python.org
Sun Mar 20 22:44:32 EDT 2016


https://hg.python.org/cpython/rev/e59b799df6e2
changeset:   100614:e59b799df6e2
parent:      100611:8b85df50d906
parent:      100613:f736aea929c2
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Sun Mar 20 16:49:29 2016 +0200
summary:
  Issue #19164: Improve exception message of uuid.UUID()

Patch by jgauthier.

files:
  Lib/uuid.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/uuid.py b/Lib/uuid.py
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -131,7 +131,8 @@
         """
 
         if [hex, bytes, bytes_le, fields, int].count(None) != 4:
-            raise TypeError('need one of hex, bytes, bytes_le, fields, or int')
+            raise TypeError('one of the hex, bytes, bytes_le, fields, '
+                            'or int arguments must be given')
         if hex is not None:
             hex = hex.replace('urn:', '').replace('uuid:', '')
             hex = hex.strip('{}').replace('-', '')

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list