Stefan Behnel wrote:
Hi Tres,
Tres Seaver wrote:
Stefan Behnel wrote:
Tres Seaver wrote:
Maybe we should return the custom doctest and wire it in via a conditional import, e.g.::
try: import doctest except ImportError: # Python < 2.4 from lxml.bbb import doctest The problem is not that it can't be imported in 2.3, it's rather that we seem to be using some features in the tests that were not yet available in 2.3's doctest module. That's harder to test... I'm attaching a patch which "fixes" this, assuming that we put the non-standard-for-Python-2.3 doctest.py into a new 'lxml.bbb' package. It still segfaults, but the tests do import from the bbb module.
Thanks for the patch. However, that's the kind of thing the "common_imports" module is there for. So here's a somewhat simpler patch that should do the same thing.
Did you forget to check in local_doctest.py? I can't make the trunk's tests work on Python 2.3. I tried copying over Python 2.4's doctest.py into src/lxml/local_doctests.py Things then fail with what looks like a new, unrelated issue: Traceback (most recent call last): File "test.py", line 591, in ? exitcode = main(sys.argv) File "test.py", line 554, in main test_cases = get_test_cases(test_files, cfg, tracer=tracer) File "test.py", line 254, in get_test_cases module = import_module(file, cfg, tracer=tracer) File "test.py", line 197, in import_module mod = __import__(modname) File "/home/faassen/working/lxml/lxml-trunk/src/lxml/tests/test_objectify.py", line 16, in ? from lxml import objectify ImportError: /home/faassen/working/lxml/lxml-trunk/src/lxml/objectify.so: undefined symbol: previousElement everything works fine in Python 2.4 though so this is rather mysterious. Regards, Martijn