code: def has_selector(selector):
      "Determine if the current platform has the selector available"
      try:
          if selector == 'poll':
              # the select module offers the poll selector even if the platform
              # doesn't support it. Attempt to poll for nothing to make sure
              # poll is available
              p = select.poll()
              p.poll(0)
          else:
              # the other selectors will fail when instantiated
              getattr(select, selector)().close()
          return True
      except (OSError, AttributeError):
          return Falsf has_selector(selector):
      "Determine if the current platform has the selector available"
      try:
          if selector == 'poll':
              # the select module offers the poll selector even if the platform
              # doesn't support it. Attempt to poll for nothing to make sure
              # poll is available
              p = select.poll()
              p.poll(0)
          else:
              # the other selectors will fail when instantiated
              getattr(select, selector)().close()
          return True
      except (OSError, AttributeError):
          return False
docs: Determine if the current platform has the selector available