docs: def _create(self):
          """Create a new connection using the creator function."""
          con = self._creator(*self._args, **self._kwargs)
          try:
              try:
                  if self._dbapi.connect != self._creator:
                      raise AttributeError
              except AttributeError:
                  # try finding the DB-API 2 module via the connection itself
                  try:
                      mod = con.__module__
                  except AttributeError:
                      mod = None
                  while mod:
                      try:
                          self._dbapi = sys.modules[mod]
                          if not callable(self._dbapi.connect):
                              raise AttributeError
                      except (AttributeError, KeyError):
                          pass
                      else:
                          break
                      i = mod.rfind('.')
                      if i < 0:
                          mod = None
                      else:
                          mod = mod[:i]
                  else:
                      try:
                          mod = con.OperationalError.__module__
                      except AttributeError:
                          mod = None
                      while mod:
                          try:
                              self._dbapi = sys.modules[mod]
                              if not callable(self._dbapi.connect):
                                  raise AttributeError
                          except (AttributeError, KeyError):
                              pass
                          else:
                              break
                          i = mod.rfind('.')
                          if i < 0:
                              mod = None
                          else:
                              mod = mod[:i]
                      else:
                          self._dbapi = None
              if self._threadsafety is None:
                  try:
                      self._threadsafety = self._dbapi.threadsafety
                  except AttributeError:
                      try:
                          self._threadsafety = con.threadsafety
                      except AttributeError:
                          pass
              if self._failures is None:
                  try:
                      self._failures = (
                          self._dbapi.OperationalError,
                          self._dbapi.InternalError)
                  except AttributeError:
                      try:
                          self._failures = (
                              self._creator.OperationalError,
                              self._creator.InternalError)
                      except AttributeError:
                          try:
                              self._failures = (
                                  con.OperationalError, con.InternalError)
                          except AttributeError:
                              raise AttributeError(
                                  "Could not determine failure exceptions"
                                  " (please set failures or creator.dbapi).")
              if isinstance(self._failures, tuple):
                  self._failure = self._failures[0]
              else:
                  self._failure = self._failures
              self._setsession(con)
          except Exception as error:
              # the database module could not be determined
              # or the session could not be prepared
              try:  # close the connection first
                  con.close()
              except Exception:
                  pass
              raise error  # re-raise the original error again
          return con