try:
    from threading import *
except ImportError:
    from dummy_threading import * as threading

But as gives a syntax error.

You can't use as with the from foo import bar syntax. What would you expect that to accomplish anyway? The whole point of using from foo is that you don't need to use a qualified name to refer to the module's function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.