bpo-19696: Replace deprecated method in "test_import_pkg.py" (GH-14466) · python/cpython@56ec4f1 (original) (raw)

Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class TestImport(unittest.TestCase):
14 14 def __init__(self, *args, **kw):
15 15 self.package_name = 'PACKAGE_'
16 16 while self.package_name in sys.modules:
17 -self.package_name += random.choose(string.ascii_letters)
17 +self.package_name += random.choice(string.ascii_letters)
18 18 self.module_name = self.package_name + '.foo'
19 19 unittest.TestCase.__init__(self, *args, **kw)
20 20
@@ -60,7 +60,7 @@ def test_package_import__semantics(self):
60 60 # ...make up a variable name that isn't bound in __builtins__
61 61 var = 'a'
62 62 while var in dir(__builtins__):
63 -var += random.choose(string.ascii_letters)
63 +var += random.choice(string.ascii_letters)
64 64
65 65 # ...make a module that just contains that
66 66 self.rewrite_file(var)