Trent Mick wrote: > That is the current state.
which reminds that maybe it's time to add an import helper to the standard library, so you can do stringio = import_search("cStringIO", "StringIO") ET = import_search("lxml.etree", "cElementTree", "xml.etree.cElementTree") db = import_search("superdb", "sqlite3", "fancydb", "dumbdb") etc. without having to type in for mod in ("cStringIO", "StringIO"): try: m = __import__(mod) for p in mod.split(".")[1:]: m = getattr(m, p, None) if m is None: raise ImportError return m except ImportError: pass else: raise ImportError(mod) all the time (or create those horridly nested try-except constructs). or perhaps try: import cStringIO as stringio retry ImportError: import StringIO as stringio except ImportError: print "didn't work!" would be a solution (sorry, wrong list). </F> _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com