Got a solution from the python bug tracker:
http://bugs.python.org/issue18525
This is an implementation artifact and would not be fixed. The import statement such as above are a wrong usage. The correct usage being(if necessary):
try:
WindowsError
except NameError:
WindowsError = None