]> granicus.if.org Git - python/commitdiff
Change a test to be more predictable.
authorGuido van Rossum <guido@python.org>
Mon, 26 Feb 2007 15:59:50 +0000 (15:59 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 26 Feb 2007 15:59:50 +0000 (15:59 +0000)
The problem with using random.random is that several modules and tests do
"from random in random" which confuses pickle.whichmodule().

Lib/pickletools.py

index 846172a8e2fcc99cb9b32ddc9ee6a50e242376f5..7fdcb70eccbb7578ca6262edfcd0a6284bdccadf 100644 (file)
@@ -2050,10 +2050,10 @@ highest protocol among opcodes = 1
 Exercise the INST/OBJ/BUILD family.
 
 >>> import random
->>> dis(pickle.dumps(random.random, 0))
-    0: c    GLOBAL     'random random'
-   15: p    PUT        0
-   18: .    STOP
+>>> dis(pickle.dumps(random.getrandbits, 0))
+    0: c    GLOBAL     'random getrandbits'
+   20: p    PUT        0
+   23: .    STOP
 highest protocol among opcodes = 0
 
 >>> from pickletools import _Example