From 07759e3786d3c26afb52d16ed794efa856c5beda Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 8 Sep 2003 19:15:43 +0000 Subject: [PATCH] Set the warnings stacklevel to two. --- Lib/random.py | 8 ++++---- Lib/sets.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/random.py b/Lib/random.py index 11059337f5d9..a26e1adf8b7a 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -333,8 +333,8 @@ class Random(_random.Random): # arc: range of distribution (in radians between 0 and pi) import warnings warnings.warn("The cunifvariate function is deprecated; Use (mean " - "+ arc * (Random.random() - 0.5)) % Math.pi instead", - DeprecationWarning) + "+ arc * (Random.random() - 0.5)) % Math.pi instead.", + DeprecationWarning, 2) return (mean + arc * (self.random() - 0.5)) % _pi @@ -487,8 +487,8 @@ class Random(_random.Random): # ccc = alpha + ainv import warnings warnings.warn("The stdgamma function is deprecated; " - "use gammavariate() instead", - DeprecationWarning) + "use gammavariate() instead.", + DeprecationWarning, 2) return self.gammavariate(alpha, 1.0) diff --git a/Lib/sets.py b/Lib/sets.py index 0da8f9fd3d05..bd2868ca4876 100644 --- a/Lib/sets.py +++ b/Lib/sets.py @@ -502,8 +502,8 @@ class Set(BaseSet): """Add all values from an iterable (such as a list or file).""" import warnings warnings.warn("The update() method is going to be deprecated; " - "Use union_update() instead", - PendingDeprecationWarning) + "Use union_update() instead.", + PendingDeprecationWarning, 2) self._update(iterable) def clear(self): -- 2.47.3