# HG changeset patch # User Paul Boddie # Date 1390948028 -3600 # Node ID 1b12cbf5419f8bf41394b58b43b36858841a74ca # Parent 98f6eeafe0d092c1c0da8edf10afb42d8792e707 Remove spurious error conditions before parsing, perhaps caused by other users of libxml2 in an Apache environment. diff -r 98f6eeafe0d0 -r 1b12cbf5419f libxml2dom/macrolib/macrolib.py --- a/libxml2dom/macrolib/macrolib.py Sun Jan 26 22:55:18 2014 +0100 +++ b/libxml2dom/macrolib/macrolib.py Tue Jan 28 23:27:08 2014 +0100 @@ -3,7 +3,7 @@ """ DOM macros for virtual libxml2mod node methods and properties. -Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Paul Boddie +Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013, 2014 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free @@ -625,6 +625,12 @@ if context is None: raise LSException(LSException.PARSE_ERR, DOMError(DOMError.SEVERITY_FATAL_ERROR)) + # Remove spurious error conditions. + + error = Parser_error() + if error is not None: + Parser_resetError(error) + Parser_configure(context, validate, remote) Parser_parse(context) doc = Parser_document(context)