Index: dist/src/Lib/string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v retrieving revision 1.61 diff -u -c -r1.61 string.py *** dist/src/Lib/string.py 30 Jan 2002 16:15:13 -0000 1.61 --- dist/src/Lib/string.py 28 Mar 2002 13:01:24 -0000 *************** *** 190,196 **** _float = float _int = int _long = long ! _StringType = type('') # Convert string to float def atof(s): --- 190,200 ---- _float = float _int = int _long = long ! _StringType = str ! try: ! _StringTypes = (str, unicode) ! except NameError: ! _StringTypes = (str,) # Convert string to float def atof(s): *************** *** 276,289 **** of the specified width. The string x is never truncated. """ ! if type(x) == type(''): s = x ! else: s = `x` ! n = len(s) ! if n >= width: return s sign = '' ! if s[0] in ('-', '+'): ! sign, s = s[0], s[1:] ! return sign + '0'*(width-n) + s # Expand tabs in a string. # Doesn't take non-printing chars into account, but does understand \n. --- 280,293 ---- of the specified width. The string x is never truncated. """ ! if not isinstance(x, _StringTypes): ! x = `x` ! n = len(x) ! if n >= width: return x sign = '' ! if x[0] in '-+': ! sign, x = x[0], x[1:] ! return sign + '0'*(width-n) + x # Expand tabs in a string. # Doesn't take non-printing chars into account, but does understand \n.