Closed GoogleCodeExporter closed 8 years ago
If I understand it correctly, your approach relies on Python<=2.5 behaviour in
which relative imports were the default. In Python>=2.6 that default has been
changed in favour of absolute imports.
I don't know of any crufty, encapsulating meta-package trick that would allow
you to continue your strategy uninterrupted. I was able to confirm that serial
replacement of "import rdflib.X" with "import .X" does eventually result in a
successful import of rdflib but I wasn't able to take it any further than that.
If there are no other options available to you then the only suggestion I can
make is that you create a separate clone of rdflib, edited to perform relative
imports as described above (assuming that it satisfactorily executes your
tests) and to use that clone for your testing.
Sorry I can't be of more help.
Original comment by gjhigg...@gmail.com
on 29 Sep 2011 at 7:21
Thanks a lot for pointing me in the right way. I hadn't noticed this change in
Python. I've been reading PEP 328 (Absolute and Relative Imports) and it seems
there is nothing to do. As you say Python 2.5 was the last version allowing
relative imports.
It's not a big problem for me to use absolute imports but I was happiest
building my own bundles and test them in other distros or shared webservers.
I'm not an python expert but I wish if instead:
from __future__ import absolute_import
I could use:
from __past__ import relative_import
Much appreciated.
Original comment by kaska...@gmail.com
on 2 Oct 2011 at 8:31
not really a bug.
Original comment by gromgull
on 12 Jan 2012 at 12:40
Original issue reported on code.google.com by
kaska...@gmail.com
on 27 Sep 2011 at 11:17