title: Availability of errno module in python across different platforms
body: <p>While reviewing the system library <code>socket.py</code> implementation I came across this code</p>
  
  <pre><code>try:
      import errno
  except ImportError:
      errno = None
  EBADF = getattr(errno, 'EBADF', 9)
  EINTR = getattr(errno, 'EINTR', 4)
  </code></pre>
  
  <p>Is this code just a relic of a bygone age, or there are platforms/implementations out there for which there is no <code>errno</code> module?</p>
  
  <p>To be more explicit, is it safe to <code>import errno</code> without an exception handler?</p>
  
  <p>I'm interested in answers for both python 2.x and 3.x.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>To clarify the question: I have to test error codes encoded in <code>IOError</code> exceptions raised inside the <code>socket</code> module. The above code, which is in the <a href="http://hg.python.org/cpython/file/219502cf57eb/Lib/socket.py" rel="nofollow">cpython code base</a>, made me suspicious about known situations in which <code>socket</code> is available, but <code>import errno</code> would fail. Maybe a minor question, but I would like to avoid unnecessary code.</p>