diff options
author | Kyle Stanley <aeros167@gmail.com> | 2019-07-03 18:22:40 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-07-03 18:22:40 (GMT) |
commit | 56ec4f1fdedd5b38deb06d94d51dd1a540262e90 (patch) | |
tree | 6a33b3d3f1c824783a0c07e710c4e2bb82ad15db /Lib | |
parent | 53c214344038341ce86fcf7efa12dc33be9d5b45 (diff) | |
download | cpython-56ec4f1fdedd5b38deb06d94d51dd1a540262e90.zip cpython-56ec4f1fdedd5b38deb06d94d51dd1a540262e90.tar.gz cpython-56ec4f1fdedd5b38deb06d94d51dd1a540262e90.tar.bz2 |
bpo-19696: Replace deprecated method in "test_import_pkg.py" (GH-14466)
Replacing the deprecated method "random.choose" to "random.choice" was technically not part of the original issue. However, it was discussed in the talk page and involved one of the files being moved. I assumed this was too minor to justify the creation of a separate issue.
Also, I added my name to the contributors list in Misc/ACKS. This will be my third PR to cpython, forgot to do it in the previous ones.
https://bugs.python.org/issue19696
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_importlib/test_pkg_import.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/test_pkg_import.py b/Lib/test/test_importlib/test_pkg_import.py index 5d9a451..6181dcf 100644 --- a/Lib/test/test_importlib/test_pkg_import.py +++ b/Lib/test/test_importlib/test_pkg_import.py @@ -14,7 +14,7 @@ class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while self.package_name in sys.modules: - self.package_name += random.choose(string.ascii_letters) + self.package_name += random.choice(string.ascii_letters) self.module_name = self.package_name + '.foo' unittest.TestCase.__init__(self, *args, **kw) @@ -60,7 +60,7 @@ class TestImport(unittest.TestCase): # ...make up a variable name that isn't bound in __builtins__ var = 'a' while var in dir(__builtins__): - var += random.choose(string.ascii_letters) + var += random.choice(string.ascii_letters) # ...make a module that just contains that self.rewrite_file(var) |