def adapt_old_url_format(self, url):
        warnings.warn("Using deprecated connection string format.", DeprecationWarning)

        password = self.options.get("PASSWORD", None)
        try:
            host, port, db = url.split(":")
            port = port if host == "unix" else int(port)
            db = int(db)

            if host == "unix":
                if password:
                    url = "unix://:{password}@{port}?db={db}"
                else:
                    url = "unix://{port}?db={db}"
            else:
                if password:
                    url = "redis://:{password}@{host}:{port}?db={db}"
                else:
                    url = "redis://{host}:{port}?db={db}"

            return url.format(password=password,
                              host=host,
                              port=port,
                              db=db)

        except (ValueError, __HOLE__):
            raise ImproperlyConfigured("Incorrect format '%s'" % (url))
dataset/ETHPy150Open niwinz/django-redis/django_redis/pool.py/ConnectionFactory.adapt_old_url_format