mirror of https://github.com/python/cpython.git
String method cleanup.
This commit is contained in:
parent
cafd495dfe
commit
c8c6aa201f
|
@ -24,7 +24,6 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
import string
|
|
||||||
import binascii
|
import binascii
|
||||||
|
|
||||||
__all__ = ["binhex","hexbin","Error"]
|
__all__ = ["binhex","hexbin","Error"]
|
||||||
|
@ -93,8 +92,7 @@ def getfileinfo(name):
|
||||||
fp = open(name)
|
fp = open(name)
|
||||||
data = open(name).read(256)
|
data = open(name).read(256)
|
||||||
for c in data:
|
for c in data:
|
||||||
if not c in string.whitespace \
|
if not c.isspace() and (c<' ' or ord(c) > 0177):
|
||||||
and (c<' ' or ord(c) > 0177):
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
finfo.Type = 'TEXT'
|
finfo.Type = 'TEXT'
|
||||||
|
|
Loading…
Reference in New Issue