try:
self.saved_dbc_key = c.current(0,0,0)[0]
except db.DBError:
- pass
+ pass
c.close()
del c
for cref in self._cursor_refs.values():
if self.linebuffer:
self.charbuffer = "".join(self.linebuffer)
self.linebuffer = None
-
+
# read until we get the required number of characters (if available)
while True:
# can the request can be satisfied from the character buffer?
if not keepends:
line = line.splitlines(False)[0]
return line
-
+
readsize = size or 72
line = ""
# If size is given, we call read() only once
global _path_created
# Detect a common bug -- name is None
- if not isinstance(name, StringTypes):
+ if not isinstance(name, StringTypes):
raise DistutilsInternalError, \
"mkpath: 'name' must be a string (got %r)" % (name,)
#
# This maps Windows language identifiers to locale strings.
#
-# This list has been updated from
+# This list has been updated from
# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp
# to include every locale up to Windows XP.
#
# Check that replacing a child with itself leaves the tree unchanged
elem.replaceChild(e, e)
confirm(e.parentNode is elem, "After replaceChild()")
-
-
-
+
+
+
def testReplaceWholeText():
def setup():
doc = parseString("<doc>a<e/>d</doc>")
f.seek(0, 2)
verify(f.tell() == 512, 'Underlying file not truncated')
f.close()
- verify(m.size() == 512, 'New size not reflected in file')
+ verify(m.size() == 512, 'New size not reflected in file')
m.close()
if x != 5:
print 'Overflow must have occurred'
print 'Poll test 3 complete'
-
+
test_poll1()
test_poll2()
def parse_http_list(s):
"""Parse lists as described by RFC 2068 Section 2.
-
+
In particular, parse comma-separated lists where the elements of
the list may include quoted-strings. A quoted-string could
contain a comma. A non-quoted string could have quotes in the
if cur == '"':
quote = True
-
+
part += cur
# append last part
(self.doc_version,self.doc_version)
tarfile = 'html-%s.tar.bz2' % self.doc_version
dirname = 'Python-Docs-%s' % self.doc_version
-
+
if os.path.exists(self.build_html):
raise RuntimeError, '%s: already exists, please remove and try again' % self.build_html
os.chdir(self.build_base)
if lines[i][:len(start)] == start:
return i
return -1
-
+
def fix(makefile, do_apply):
"""Fix the Makefile, if required."""
fixed = False
lines = open(makefile).readlines()
-
+
for old, new in CHANGES:
i = findline(lines, new)
if i >= 0:
return 2
lines[i] = new
fixed = True
-
+
if fixed:
if do_apply:
print 'fixapplepython23: Fix to Apple-installed Python 2.3 applied'
else:
print 'fixapplepython23: No fix needed, appears to have been applied before'
return 0
-
+
def makescript(filename, compiler):
"""Create a wrapper script for a compiler"""
dirname = os.path.split(filename)[0]
fp.close()
os.chmod(filename, 0755)
print 'fixapplepython23: Created', filename
-
+
def main():
# Check for -n option
if len(sys.argv) > 1 and sys.argv[1] == '-n':
# Finally fix the makefile
rv = fix(MAKEFILE, do_apply)
sys.exit(rv)
-
+
if __name__ == '__main__':
main()
-
"24":"{9B81E618-2301-4035-AC77-75D9ABEB7301}",
"25":"{2e41b118-38bd-4c1b-a840-6977efd1b911}"
} [major+minor]
-
+
# Build the mingw import library, libpythonXY.a
# This requires 'nm' and 'dlltool' executables on your PATH
line = line.split()
remove_modules.append(line[0])
input.close()
-
+
for ext in self.extensions[:]:
if ext.name in remove_modules:
self.extensions.remove(ext)