From b0f3ae07d998fb493bf8450bb5467ea1bd0a7464 Mon Sep 17 00:00:00 2001 From: Alan Justino Date: Thu, 12 Jul 2018 15:24:52 -0300 Subject: [PATCH] [FIX] urlparse() misbehaves on underscores on scheme part --- celery_serverless/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/celery_serverless/utils.py b/celery_serverless/utils.py index b960bf9..8af4fb2 100644 --- a/celery_serverless/utils.py +++ b/celery_serverless/utils.py @@ -3,7 +3,6 @@ import asyncio from threading import Thread from inspect import isawaitable -from urllib.parse import urlparse import importlib try: @@ -72,7 +71,7 @@ def _get_lock(lock_url='', lock_url_env='CELERY_SERVERLESS_LOCK_URL', lock_url_d redis = StrictRedis.from_url(lock_url) lock = redis.lock(lock_name) elif lock_url_default and not lock_url: - defaultlock_module_name = urlparse(lock_url_default).scheme + defaultlock_module_name = lock_url_default.partition('://')[0] defaultlock_module = importlib.import_module(defaultlock_module_name) lock = defaultlock_module.Lock() else: