Skip to content

Commit 0dcfade

Browse files
committed
Make confvalue() never return None
There are three places in the code where the return value of confvalue() is concatenated with a string, which fails if the value is None. Rather than changing them all, I thought it would be better to make confvalue() return an empty string if the configuration for that value is absent.
1 parent f71c585 commit 0dcfade

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/storm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def confvalue(name, extrapaths):
6262
tokens = line.split(" ")
6363
if tokens[0] == "VALUE:":
6464
return " ".join(tokens[1:])
65+
return ""
6566

6667
def print_localconfvalue(name):
6768
"""Syntax: [storm localconfvalue conf-name]
@@ -97,7 +98,7 @@ def parse_args(string):
9798
'(?: [^'\\] | \\.)*' |
9899
\\.
99100
)+)''', re.VERBOSE)
100-
args = re_split.split(string or '')[1::2]
101+
args = re_split.split(string)[1::2]
101102
args = [re.compile(r'"((?:[^"\\]|\\.)*)"').sub('\\1', x) for x in args]
102103
args = [re.compile(r"'((?:[^'\\]|\\.)*)'").sub('\\1', x) for x in args]
103104
return [re.compile(r'\\(.)').sub('\\1', x) for x in args]

0 commit comments

Comments
 (0)