diff options
author | Guido van Rossum <guido@python.org> | 2007-02-26 15:59:50 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-02-26 15:59:50 (GMT) |
commit | 4f7ac2e8005d9e5b129a61b49ae3c7fcbacc478d (patch) | |
tree | c4a299111c6d32dc5ebd2c1788125edceb24858a | |
parent | 61c31b07b9cb6aea725ee867ea3e9a3ddaa43985 (diff) | |
download | cpython-4f7ac2e8005d9e5b129a61b49ae3c7fcbacc478d.zip cpython-4f7ac2e8005d9e5b129a61b49ae3c7fcbacc478d.tar.gz cpython-4f7ac2e8005d9e5b129a61b49ae3c7fcbacc478d.tar.bz2 |
Change a test to be more predictable.
The problem with using random.random is that several modules and tests do
"from random in random" which confuses pickle.whichmodule().
-rw-r--r-- | Lib/pickletools.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py index 846172a..7fdcb70 100644 --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -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 |