transition basestring
to str
https://github.com/fonttools/fonttools/issues/2232
This commit is contained in:
parent
c2ba06dccc
commit
7abf2e4c75
@ -118,7 +118,7 @@ class CFFFontSet(object):
|
|||||||
"""
|
"""
|
||||||
if hasattr(nameOrIndex, "__index__"):
|
if hasattr(nameOrIndex, "__index__"):
|
||||||
index = nameOrIndex.__index__()
|
index = nameOrIndex.__index__()
|
||||||
elif isinstance(nameOrIndex, basestring):
|
elif isinstance(nameOrIndex, str):
|
||||||
name = nameOrIndex
|
name = nameOrIndex
|
||||||
try:
|
try:
|
||||||
index = self.fontNames.index(name)
|
index = self.fontNames.index(name)
|
||||||
@ -261,7 +261,7 @@ class CFFFontSet(object):
|
|||||||
self.topDictIndex = TopDictIndex(None, cff2GetGlyphOrder, None)
|
self.topDictIndex = TopDictIndex(None, cff2GetGlyphOrder, None)
|
||||||
self.topDictIndex.append(topDict)
|
self.topDictIndex.append(topDict)
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
topDict.fromXML(name, attrs, content)
|
topDict.fromXML(name, attrs, content)
|
||||||
@ -277,7 +277,7 @@ class CFFFontSet(object):
|
|||||||
if not hasattr(self, "GlobalSubrs"):
|
if not hasattr(self, "GlobalSubrs"):
|
||||||
self.GlobalSubrs = GlobalSubrsIndex()
|
self.GlobalSubrs = GlobalSubrsIndex()
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
subr = subrCharStringClass()
|
subr = subrCharStringClass()
|
||||||
@ -879,7 +879,7 @@ class FDArrayIndex(Index):
|
|||||||
return
|
return
|
||||||
fontDict = FontDict()
|
fontDict = FontDict()
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
fontDict.fromXML(name, attrs, content)
|
fontDict.fromXML(name, attrs, content)
|
||||||
@ -1106,7 +1106,7 @@ class CharStrings(object):
|
|||||||
|
|
||||||
def fromXML(self, name, attrs, content):
|
def fromXML(self, name, attrs, content):
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
if name != "CharString":
|
if name != "CharString":
|
||||||
@ -1282,7 +1282,7 @@ def parseNum(s):
|
|||||||
def parseBlendList(s):
|
def parseBlendList(s):
|
||||||
valueList = []
|
valueList = []
|
||||||
for element in s:
|
for element in s:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
blendList = attrs["value"].split()
|
blendList = attrs["value"].split()
|
||||||
@ -1358,7 +1358,7 @@ class TableConverter(SimpleConverter):
|
|||||||
def xmlRead(self, name, attrs, content, parent):
|
def xmlRead(self, name, attrs, content, parent):
|
||||||
ob = self.getClass()()
|
ob = self.getClass()()
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
ob.fromXML(name, attrs, content)
|
ob.fromXML(name, attrs, content)
|
||||||
@ -1650,7 +1650,7 @@ def parseCharset(numGlyphs, file, strings, isCID, fmt):
|
|||||||
class EncodingCompiler(object):
|
class EncodingCompiler(object):
|
||||||
|
|
||||||
def __init__(self, strings, encoding, parent):
|
def __init__(self, strings, encoding, parent):
|
||||||
assert not isinstance(encoding, basestring)
|
assert not isinstance(encoding, str)
|
||||||
data0 = packEncoding0(parent.dictObj.charset, encoding, parent.strings)
|
data0 = packEncoding0(parent.dictObj.charset, encoding, parent.strings)
|
||||||
data1 = packEncoding1(parent.dictObj.charset, encoding, parent.strings)
|
data1 = packEncoding1(parent.dictObj.charset, encoding, parent.strings)
|
||||||
if len(data0) < len(data1):
|
if len(data0) < len(data1):
|
||||||
@ -1721,7 +1721,7 @@ class EncodingConverter(SimpleConverter):
|
|||||||
return attrs["name"]
|
return attrs["name"]
|
||||||
encoding = [".notdef"] * 256
|
encoding = [".notdef"] * 256
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
code = safeEval(attrs["code"])
|
code = safeEval(attrs["code"])
|
||||||
@ -1833,7 +1833,7 @@ class FDArrayConverter(TableConverter):
|
|||||||
def xmlRead(self, name, attrs, content, parent):
|
def xmlRead(self, name, attrs, content, parent):
|
||||||
fdArray = FDArrayIndex()
|
fdArray = FDArrayIndex()
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
fdArray.fromXML(name, attrs, content)
|
fdArray.fromXML(name, attrs, content)
|
||||||
@ -2332,7 +2332,7 @@ class TopDictCompiler(DictCompiler):
|
|||||||
self.rawDict["charset"] = charsetCode
|
self.rawDict["charset"] = charsetCode
|
||||||
if hasattr(self.dictObj, "Encoding") and self.dictObj.Encoding:
|
if hasattr(self.dictObj, "Encoding") and self.dictObj.Encoding:
|
||||||
encoding = self.dictObj.Encoding
|
encoding = self.dictObj.Encoding
|
||||||
if not isinstance(encoding, basestring):
|
if not isinstance(encoding, str):
|
||||||
children.append(EncodingCompiler(strings, encoding, self))
|
children.append(EncodingCompiler(strings, encoding, self))
|
||||||
else:
|
else:
|
||||||
if hasattr(self.dictObj, "VarStore"):
|
if hasattr(self.dictObj, "VarStore"):
|
||||||
|
@ -18,7 +18,7 @@ from fontTools.cffLib import maxStackLimit
|
|||||||
|
|
||||||
|
|
||||||
def stringToProgram(string):
|
def stringToProgram(string):
|
||||||
if isinstance(string, basestring):
|
if isinstance(string, str):
|
||||||
string = string.split()
|
string = string.split()
|
||||||
program = []
|
program = []
|
||||||
for token in string:
|
for token in string:
|
||||||
@ -70,7 +70,7 @@ def programToCommands(program, getNumRegions=None):
|
|||||||
it = iter(program)
|
it = iter(program)
|
||||||
|
|
||||||
for token in it:
|
for token in it:
|
||||||
if not isinstance(token, basestring):
|
if not isinstance(token, str):
|
||||||
stack.append(token)
|
stack.append(token)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ class FontBuilder(object):
|
|||||||
nameID = nameName
|
nameID = nameName
|
||||||
else:
|
else:
|
||||||
nameID = _nameIDs[nameName]
|
nameID = _nameIDs[nameName]
|
||||||
if isinstance(nameValue, basestring):
|
if isinstance(nameValue, str):
|
||||||
nameValue = dict(en=nameValue)
|
nameValue = dict(en=nameValue)
|
||||||
nameTable.addMultilingualName(
|
nameTable.addMultilingualName(
|
||||||
nameValue, ttFont=self.font, nameID=nameID, windows=windows, mac=mac
|
nameValue, ttFont=self.font, nameID=nameID, windows=windows, mac=mac
|
||||||
|
@ -11,7 +11,7 @@ or subclasses built-in ElementTree classes to add features that are
|
|||||||
only availble in lxml, like OrderedDict for attributes, pretty_print and
|
only availble in lxml, like OrderedDict for attributes, pretty_print and
|
||||||
iterwalk.
|
iterwalk.
|
||||||
"""
|
"""
|
||||||
from fontTools.misc.py23 import basestring, unicode, tounicode, open
|
from fontTools.misc.py23 import unicode, tounicode, open
|
||||||
|
|
||||||
|
|
||||||
XML_DECLARATION = """<?xml version='1.0' encoding='%s'?>"""
|
XML_DECLARATION = """<?xml version='1.0' encoding='%s'?>"""
|
||||||
@ -356,7 +356,7 @@ except ImportError:
|
|||||||
if isinstance(tag, QName):
|
if isinstance(tag, QName):
|
||||||
if tag.text not in qnames:
|
if tag.text not in qnames:
|
||||||
add_qname(tag.text)
|
add_qname(tag.text)
|
||||||
elif isinstance(tag, basestring):
|
elif isinstance(tag, str):
|
||||||
if tag not in qnames:
|
if tag not in qnames:
|
||||||
add_qname(tag)
|
add_qname(tag)
|
||||||
elif tag is not None and tag is not Comment and tag is not PI:
|
elif tag is not None and tag is not Comment and tag is not PI:
|
||||||
|
@ -16,7 +16,7 @@ by Tal Leming and is copyright (c) 2005-2016, The RoboFab Developers:
|
|||||||
- Tal Leming
|
- Tal Leming
|
||||||
- Just van Rossum
|
- Just van Rossum
|
||||||
"""
|
"""
|
||||||
from fontTools.misc.py23 import basestring, unicode
|
from fontTools.misc.py23 import unicode
|
||||||
|
|
||||||
illegalCharacters = r"\" * + / : < > ? [ \ ] | \0".split(" ")
|
illegalCharacters = r"\" * + / : < > ? [ \ ] | \0".split(" ")
|
||||||
illegalCharacters += [chr(i) for i in range(1, 32)]
|
illegalCharacters += [chr(i) for i in range(1, 32)]
|
||||||
|
@ -60,7 +60,7 @@ class LevelFormatter(logging.Formatter):
|
|||||||
"only '%' percent style is supported in both python 2 and 3")
|
"only '%' percent style is supported in both python 2 and 3")
|
||||||
if fmt is None:
|
if fmt is None:
|
||||||
fmt = DEFAULT_FORMATS
|
fmt = DEFAULT_FORMATS
|
||||||
if isinstance(fmt, basestring):
|
if isinstance(fmt, str):
|
||||||
default_format = fmt
|
default_format = fmt
|
||||||
custom_formats = {}
|
custom_formats = {}
|
||||||
elif isinstance(fmt, Mapping):
|
elif isinstance(fmt, Mapping):
|
||||||
@ -151,7 +151,7 @@ def configLogger(**kwargs):
|
|||||||
handlers = [h]
|
handlers = [h]
|
||||||
# By default, the top-level library logger is configured.
|
# By default, the top-level library logger is configured.
|
||||||
logger = kwargs.pop("logger", "fontTools")
|
logger = kwargs.pop("logger", "fontTools")
|
||||||
if not logger or isinstance(logger, basestring):
|
if not logger or isinstance(logger, str):
|
||||||
# empty "" or None means the 'root' logger
|
# empty "" or None means the 'root' logger
|
||||||
logger = logging.getLogger(logger)
|
logger = logging.getLogger(logger)
|
||||||
# before (re)configuring, reset named logger and its children (if exist)
|
# before (re)configuring, reset named logger and its children (if exist)
|
||||||
@ -436,7 +436,7 @@ class CapturingLogHandler(logging.Handler):
|
|||||||
def __init__(self, logger, level):
|
def __init__(self, logger, level):
|
||||||
super(CapturingLogHandler, self).__init__(level=level)
|
super(CapturingLogHandler, self).__init__(level=level)
|
||||||
self.records = []
|
self.records = []
|
||||||
if isinstance(logger, basestring):
|
if isinstance(logger, str):
|
||||||
self.logger = logging.getLogger(logger)
|
self.logger = logging.getLogger(logger)
|
||||||
else:
|
else:
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
|
@ -997,7 +997,7 @@ class T2CharString(object):
|
|||||||
# If present, remove return and endchar operators.
|
# If present, remove return and endchar operators.
|
||||||
if program and program[-1] in ("return", "endchar"):
|
if program and program[-1] in ("return", "endchar"):
|
||||||
program = program[:-1]
|
program = program[:-1]
|
||||||
elif program and not isinstance(program[-1], basestring):
|
elif program and not isinstance(program[-1], str):
|
||||||
raise CharStringCompileError(
|
raise CharStringCompileError(
|
||||||
"T2CharString or Subr has items on the stack after last operator."
|
"T2CharString or Subr has items on the stack after last operator."
|
||||||
)
|
)
|
||||||
@ -1010,7 +1010,7 @@ class T2CharString(object):
|
|||||||
while i < end:
|
while i < end:
|
||||||
token = program[i]
|
token = program[i]
|
||||||
i = i + 1
|
i = i + 1
|
||||||
if isinstance(token, basestring):
|
if isinstance(token, str):
|
||||||
try:
|
try:
|
||||||
bytecode.extend(bytechr(b) for b in opcodes[token])
|
bytecode.extend(bytechr(b) for b in opcodes[token])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -1043,8 +1043,7 @@ class T2CharString(object):
|
|||||||
self.program = None
|
self.program = None
|
||||||
|
|
||||||
def getToken(self, index,
|
def getToken(self, index,
|
||||||
len=len, byteord=byteord, basestring=basestring,
|
len=len, byteord=byteord, isinstance=isinstance):
|
||||||
isinstance=isinstance):
|
|
||||||
if self.bytecode is not None:
|
if self.bytecode is not None:
|
||||||
if index >= len(self.bytecode):
|
if index >= len(self.bytecode):
|
||||||
return None, 0, 0
|
return None, 0, 0
|
||||||
@ -1057,7 +1056,7 @@ class T2CharString(object):
|
|||||||
return None, 0, 0
|
return None, 0, 0
|
||||||
token = self.program[index]
|
token = self.program[index]
|
||||||
index = index + 1
|
index = index + 1
|
||||||
isOperator = isinstance(token, basestring)
|
isOperator = isinstance(token, str)
|
||||||
return token, isOperator, index
|
return token, isOperator, index
|
||||||
|
|
||||||
def getBytes(self, index, nBytes):
|
def getBytes(self, index, nBytes):
|
||||||
|
@ -68,7 +68,7 @@ def pack(fmt, obj):
|
|||||||
if name in fixes:
|
if name in fixes:
|
||||||
# fixed point conversion
|
# fixed point conversion
|
||||||
value = fl2fi(value, fixes[name])
|
value = fl2fi(value, fixes[name])
|
||||||
elif isinstance(value, basestring):
|
elif isinstance(value, str):
|
||||||
value = tobytes(value)
|
value = tobytes(value)
|
||||||
elements.append(value)
|
elements.append(value)
|
||||||
data = struct.pack(*(formatstring,) + tuple(elements))
|
data = struct.pack(*(formatstring,) + tuple(elements))
|
||||||
|
@ -12,7 +12,7 @@ safeEval = ast.literal_eval
|
|||||||
|
|
||||||
def readHex(content):
|
def readHex(content):
|
||||||
"""Convert a list of hex strings to binary data."""
|
"""Convert a list of hex strings to binary data."""
|
||||||
return deHexStr(strjoin(chunk for chunk in content if isinstance(chunk, basestring)))
|
return deHexStr(strjoin(chunk for chunk in content if isinstance(chunk, str)))
|
||||||
|
|
||||||
|
|
||||||
def deHexStr(hexdata):
|
def deHexStr(hexdata):
|
||||||
|
@ -40,7 +40,7 @@ class SFNTResourceReader(BytesIO):
|
|||||||
def __init__(self, path, res_name_or_index):
|
def __init__(self, path, res_name_or_index):
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
reader = ResourceReader(path)
|
reader = ResourceReader(path)
|
||||||
if isinstance(res_name_or_index, basestring):
|
if isinstance(res_name_or_index, str):
|
||||||
rsrc = reader.getNamedResource('sfnt', res_name_or_index)
|
rsrc = reader.getNamedResource('sfnt', res_name_or_index)
|
||||||
else:
|
else:
|
||||||
rsrc = reader.getIndResource('sfnt', res_name_or_index)
|
rsrc = reader.getIndResource('sfnt', res_name_or_index)
|
||||||
|
@ -105,11 +105,11 @@ class table_C_O_L_R_(DefaultTable.DefaultTable):
|
|||||||
self.ColorLayers = {}
|
self.ColorLayers = {}
|
||||||
glyphName = attrs["name"]
|
glyphName = attrs["name"]
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
layers = []
|
layers = []
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
layer = LayerRecord()
|
layer = LayerRecord()
|
||||||
layer.fromXML(element[0], element[1], element[2], ttFont)
|
layer.fromXML(element[0], element[1], element[2], ttFont)
|
||||||
|
@ -208,7 +208,7 @@ class table_C_P_A_L_(DefaultTable.DefaultTable):
|
|||||||
self.paletteTypes.append(int(attrs.get("type", self.DEFAULT_PALETTE_TYPE)))
|
self.paletteTypes.append(int(attrs.get("type", self.DEFAULT_PALETTE_TYPE)))
|
||||||
palette = []
|
palette = []
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
attrs = element[1]
|
attrs = element[1]
|
||||||
color = Color.fromHex(attrs["value"])
|
color = Color.fromHex(attrs["value"])
|
||||||
@ -217,7 +217,7 @@ class table_C_P_A_L_(DefaultTable.DefaultTable):
|
|||||||
elif name == "paletteEntryLabels":
|
elif name == "paletteEntryLabels":
|
||||||
colorLabels = {}
|
colorLabels = {}
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
elementName, elementAttr, _ = element
|
elementName, elementAttr, _ = element
|
||||||
if elementName == "label":
|
if elementName == "label":
|
||||||
|
@ -115,7 +115,7 @@ class table_G_M_A_P_(DefaultTable.DefaultTable):
|
|||||||
gmapRecord = GMAPRecord()
|
gmapRecord = GMAPRecord()
|
||||||
self.gmapRecords.append(gmapRecord)
|
self.gmapRecords.append(gmapRecord)
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
gmapRecord.fromXML(name, attrs, content, ttFont)
|
gmapRecord.fromXML(name, attrs, content, ttFont)
|
||||||
|
@ -106,7 +106,7 @@ class table_G_P_K_G_(DefaultTable.DefaultTable):
|
|||||||
if not hasattr(self, "GMAPs"):
|
if not hasattr(self, "GMAPs"):
|
||||||
self.GMAPs = []
|
self.GMAPs = []
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
itemName, itemAttrs, itemContent = element
|
itemName, itemAttrs, itemContent = element
|
||||||
if itemName == "hexdata":
|
if itemName == "hexdata":
|
||||||
@ -115,7 +115,7 @@ class table_G_P_K_G_(DefaultTable.DefaultTable):
|
|||||||
if not hasattr(self, "glyphlets"):
|
if not hasattr(self, "glyphlets"):
|
||||||
self.glyphlets = []
|
self.glyphlets = []
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
itemName, itemAttrs, itemContent = element
|
itemName, itemAttrs, itemContent = element
|
||||||
if itemName == "hexdata":
|
if itemName == "hexdata":
|
||||||
|
@ -173,7 +173,7 @@ class table_M_E_T_A_(DefaultTable.DefaultTable):
|
|||||||
glyphRec = GlyphRecord()
|
glyphRec = GlyphRecord()
|
||||||
self.glyphRecords.append(glyphRec)
|
self.glyphRecords.append(glyphRec)
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
glyphRec.fromXML(name, attrs, content, ttFont)
|
glyphRec.fromXML(name, attrs, content, ttFont)
|
||||||
@ -207,7 +207,7 @@ class GlyphRecord(object):
|
|||||||
stringRec = StringRecord()
|
stringRec = StringRecord()
|
||||||
self.stringRecs.append(stringRec)
|
self.stringRecs.append(stringRec)
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
stringRec.fromXML(name, attrs, content, ttFont)
|
stringRec.fromXML(name, attrs, content, ttFont)
|
||||||
stringRec.stringLen = len(stringRec.string)
|
stringRec.stringLen = len(stringRec.string)
|
||||||
@ -281,7 +281,7 @@ class StringRecord(object):
|
|||||||
|
|
||||||
def fromXML(self, name, attrs, content, ttFont):
|
def fromXML(self, name, attrs, content, ttFont):
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
value = attrs["value"]
|
value = attrs["value"]
|
||||||
|
@ -84,7 +84,7 @@ class table_V_O_R_G_(DefaultTable.DefaultTable):
|
|||||||
if name == "VOriginRecord":
|
if name == "VOriginRecord":
|
||||||
vOriginRec = VOriginRecord()
|
vOriginRec = VOriginRecord()
|
||||||
for element in content:
|
for element in content:
|
||||||
if isinstance(element, basestring):
|
if isinstance(element, str):
|
||||||
continue
|
continue
|
||||||
name, attrs, content = element
|
name, attrs, content = element
|
||||||
vOriginRec.fromXML(name, attrs, content, ttFont)
|
vOriginRec.fromXML(name, attrs, content, ttFont)
|
||||||
|
@ -16,7 +16,7 @@ def _makeunicodes(f):
|
|||||||
class _UnicodeCustom(object):
|
class _UnicodeCustom(object):
|
||||||
|
|
||||||
def __init__(self, f):
|
def __init__(self, f):
|
||||||
if isinstance(f, basestring):
|
if isinstance(f, str):
|
||||||
with open(f) as fd:
|
with open(f) as fd:
|
||||||
codes = _makeunicodes(fd)
|
codes = _makeunicodes(fd)
|
||||||
else:
|
else:
|
||||||
|
@ -7,7 +7,7 @@ import pytest
|
|||||||
|
|
||||||
|
|
||||||
def test_asctime():
|
def test_asctime():
|
||||||
assert isinstance(asctime(), basestring)
|
assert isinstance(asctime(), str)
|
||||||
assert asctime(time.gmtime(0)) == 'Thu Jan 1 00:00:00 1970'
|
assert asctime(time.gmtime(0)) == 'Thu Jan 1 00:00:00 1970'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user