Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83ff749

Browse files
String method conversion.
1 parent 2846b0a commit 83ff749

4 files changed

Lines changed: 6 additions & 10 deletions

File tree

Lib/test/test_socket.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import socket
1313
import os
1414
import time
15-
import string
1615

1716
def missing_ok(str):
1817
try:
@@ -79,7 +78,7 @@ def missing_ok(str):
7978
print all_host_names
8079

8180
for name in all_host_names:
82-
if string.find(name, '.'):
81+
if name.find('.'):
8382
break
8483
else:
8584
print 'FQDN not found'

Lib/test/test_strftime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Sanity checker for time.strftime
44

5-
import time, calendar, sys, string, os, re
5+
import time, calendar, sys, os, re
66
from test_support import verbose
77

88
def main():
@@ -90,7 +90,7 @@ def strftest(now):
9090

9191
if verbose:
9292
print "Strftime test, platform: %s, Python version: %s" % \
93-
(sys.platform, string.split(sys.version)[0])
93+
(sys.platform, sys.version.split()[0])
9494

9595
for e in expectations:
9696
try:

Lib/test/test_zlib.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import zlib
22
import sys
33
import imp
4-
import string
54

65
try:
76
t = imp.find_module('test_zlib')
@@ -57,7 +56,7 @@
5756
for i in range(0, len(buf), 256):
5857
bufs.append(co.compress(buf[i:i+256]))
5958
bufs.append(co.flush())
60-
combuf = string.join(bufs, '')
59+
combuf = ''.join(bufs)
6160

6261
decomp1 = zlib.decompress(combuf, -12, -5)
6362
if decomp1 != buf:
@@ -70,7 +69,7 @@
7069
for i in range(0, len(combuf), 128):
7170
bufs.append(deco.decompress(combuf[i:i+128]))
7271
bufs.append(deco.flush())
73-
decomp2 = string.join(buf, '')
72+
decomp2 = ''.join(buf)
7473
if decomp2 != buf:
7574
print "decompressobj with init options failed"
7675
else:

Lib/xml/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515

1616
__all__ = ["dom", "parsers", "sax"]
1717

18-
import string
19-
__version__ = string.split("$Revision$")[1]
20-
del string
18+
__version__ = "$Revision$".split()[1]
2119

2220

2321
_MINIMUM_XMLPLUS_VERSION = (0, 6, 1)

0 commit comments

Comments
 (0)