]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Set the warnings stacklevel to two.
authorRaymond Hettinger <python@rcn.com>
Mon, 8 Sep 2003 19:15:43 +0000 (19:15 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 8 Sep 2003 19:15:43 +0000 (19:15 +0000)
Lib/random.py
Lib/sets.py

index 11059337f5d9341f265fff4844ee6d4294168086..a26e1adf8b7a2894c8ed37c9b95d853e334ce096 100644 (file)
@@ -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)
 
 
index 0da8f9fd3d05cd8981e60cf10c8b885c85b92aad..bd2868ca4876895d16d1e066d0c790eb5e2b1695 100644 (file)
@@ -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):