| @@ -227,11 +227,9 @@ def parsesockstr(sockstr): | |||||
| if '=' not in rem: | if '=' not in rem: | ||||
| if proto == 'unix' and rem[0] != '/': | if proto == 'unix' and rem[0] != '/': | ||||
| raise ValueError('bare path MUST start w/ a slash (/).') | raise ValueError('bare path MUST start w/ a slash (/).') | ||||
| if proto == 'unix': | |||||
| elif proto == 'unix': | |||||
| args = { 'path': rem } | args = { 'path': rem } | ||||
| if proto == 'udp': | |||||
| elif proto in ('tcp', 'udp'): | |||||
| h, p = rem.split(':') | h, p = rem.split(':') | ||||
| args = { 'host': h, 'port': p } | args = { 'host': h, 'port': p } | ||||
| else: | else: | ||||
| @@ -557,6 +555,8 @@ class Tests_misc(unittest.TestCase): | |||||
| # function | # function | ||||
| 'unix:/apath': ('unix', { 'path': '/apath' }), | 'unix:/apath': ('unix', { 'path': '/apath' }), | ||||
| 'unix:path=apath': ('unix', { 'path': 'apath' }), | 'unix:path=apath': ('unix', { 'path': 'apath' }), | ||||
| 'tcp:ahost:1234': ('tcp', { 'host': 'ahost', | |||||
| 'port': 1234 }), | |||||
| 'tcp:host=apath': ('tcp', { 'host': 'apath' }), | 'tcp:host=apath': ('tcp', { 'host': 'apath' }), | ||||
| 'tcp:host=apath,port=5': ('tcp', { 'host': 'apath', | 'tcp:host=apath,port=5': ('tcp', { 'host': 'apath', | ||||
| 'port': 5 }), | 'port': 5 }), | ||||