Skip to content

Commit

Permalink
[FIX] urlparse() misbehaves on underscores on scheme part
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjds committed Jul 12, 2018
1 parent bdae12c commit b0f3ae0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions celery_serverless/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import asyncio
from threading import Thread
from inspect import isawaitable
from urllib.parse import urlparse
import importlib

try:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b0f3ae0

Please sign in to comment.