mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Remove functions in string module that are also string methods. Also remove:
* all calls to functions in the string module (except maketrans) * everything from stropmodule except for maketrans() which is still used
This commit is contained in:
parent
ff11334927
commit
9d72bb452b
69 changed files with 396 additions and 2113 deletions
|
@ -2,7 +2,7 @@
|
|||
TestCases for DB.associate.
|
||||
"""
|
||||
|
||||
import sys, os, string
|
||||
import sys, os
|
||||
import tempfile
|
||||
import time
|
||||
from pprint import pprint
|
||||
|
@ -177,7 +177,7 @@ class AssociateTestCase(unittest.TestCase):
|
|||
for key, value in musicdata.items():
|
||||
if type(self.keytype) == type(''):
|
||||
key = "%02d" % key
|
||||
d.put(key, string.join(value, '|'), txn=txn)
|
||||
d.put(key, '|'.join(value), txn=txn)
|
||||
|
||||
def createDB(self, txn=None):
|
||||
self.cur = None
|
||||
|
@ -263,7 +263,7 @@ class AssociateTestCase(unittest.TestCase):
|
|||
rec = self.cur.first()
|
||||
while rec is not None:
|
||||
if type(self.keytype) == type(''):
|
||||
assert string.atoi(rec[0]) # for primary db, key is a number
|
||||
assert int(rec[0]) # for primary db, key is a number
|
||||
else:
|
||||
assert rec[0] and type(rec[0]) == type(0)
|
||||
count = count + 1
|
||||
|
@ -305,7 +305,7 @@ class AssociateTestCase(unittest.TestCase):
|
|||
assert type(priData) == type("")
|
||||
if verbose:
|
||||
print('getGenre key: %r data: %r' % (priKey, priData))
|
||||
genre = string.split(priData, '|')[2]
|
||||
genre = priData.split('|')[2]
|
||||
if genre == 'Blues':
|
||||
return db.DB_DONOTINDEX
|
||||
else:
|
||||
|
@ -427,13 +427,13 @@ class ThreadedAssociateTestCase(AssociateTestCase):
|
|||
for key, value in musicdata.items():
|
||||
if type(self.keytype) == type(''):
|
||||
key = "%02d" % key
|
||||
d.put(key, string.join(value, '|'))
|
||||
d.put(key, '|'.join(value))
|
||||
|
||||
def writer2(self, d):
|
||||
for x in range(100, 600):
|
||||
key = 'z%2d' % x
|
||||
value = [key] * 4
|
||||
d.put(key, string.join(value, '|'))
|
||||
d.put(key, '|'.join(value))
|
||||
|
||||
|
||||
class ThreadedAssociateHashTestCase(ShelveAssociateTestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue