mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fixed unreachable code surrounding 'unix://' addresses.
This commit is contained in:
parent
fb4ffb269b
commit
318b365b8a
@ -123,7 +123,7 @@ def load_class(uri, default="sync", section="gunicorn.workers"):
|
|||||||
return pkg_resources.load_entry_point(dist, section, name)
|
return pkg_resources.load_entry_point(dist, section, name)
|
||||||
except:
|
except:
|
||||||
exc = traceback.format_exc()
|
exc = traceback.format_exc()
|
||||||
raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
|
raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
|
||||||
exc))
|
exc))
|
||||||
else:
|
else:
|
||||||
components = uri.split('.')
|
components = uri.split('.')
|
||||||
@ -136,7 +136,7 @@ def load_class(uri, default="sync", section="gunicorn.workers"):
|
|||||||
section, uri)
|
section, uri)
|
||||||
except:
|
except:
|
||||||
exc = traceback.format_exc()
|
exc = traceback.format_exc()
|
||||||
raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
|
raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
|
||||||
exc))
|
exc))
|
||||||
|
|
||||||
klass = components.pop(-1)
|
klass = components.pop(-1)
|
||||||
@ -144,7 +144,7 @@ def load_class(uri, default="sync", section="gunicorn.workers"):
|
|||||||
mod = __import__('.'.join(components))
|
mod = __import__('.'.join(components))
|
||||||
except:
|
except:
|
||||||
exc = traceback.format_exc()
|
exc = traceback.format_exc()
|
||||||
raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
|
raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
|
||||||
exc))
|
exc))
|
||||||
|
|
||||||
for comp in components[1:]:
|
for comp in components[1:]:
|
||||||
@ -235,12 +235,12 @@ def is_ipv6(addr):
|
|||||||
|
|
||||||
|
|
||||||
def parse_address(netloc, default_port=8000):
|
def parse_address(netloc, default_port=8000):
|
||||||
if netloc.startswith("unix:"):
|
|
||||||
return netloc.split("unix:")[1]
|
|
||||||
|
|
||||||
if netloc.startswith("unix://"):
|
if netloc.startswith("unix://"):
|
||||||
return netloc.split("unix://")[1]
|
return netloc.split("unix://")[1]
|
||||||
|
|
||||||
|
if netloc.startswith("unix:"):
|
||||||
|
return netloc.split("unix:")[1]
|
||||||
|
|
||||||
if netloc.startswith("tcp://"):
|
if netloc.startswith("tcp://"):
|
||||||
netloc = netloc.split("tcp://")[1]
|
netloc = netloc.split("tcp://")[1]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user