--- lxml-3.0.2/src/lxml/parser.pxi 2012-10-07 20:04:15.000000000 +0200 +++ lxml-3.0.2-changed/src/lxml/parser.pxi 2013-01-11 10:23:36.448599278 +0100 @@ -500,7 +500,7 @@ def __dealloc__(self): if self._validator is not None: self._validator.disconnect() - if self._lock is not NULL: + if config.ENABLE_THREADING and self._lock is not NULL: python.PyThread_free_lock(self._lock) if self._c_ctxt is not NULL: xmlparser.xmlFreeParserCtxt(self._c_ctxt)