Skip to content

Commit 39d4219

Browse files
committed
check for None in regex find
1 parent d3a881f commit 39d4219

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77

88
version = ''
99
with open('discord/__init__.py') as f:
10-
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
10+
11+
search = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE)
12+
13+
if search is not None:
14+
version = search.group(1)
15+
16+
else:
17+
raise RuntimeError("Could not grab version string")
1118

1219
if not version:
1320
raise RuntimeError('version is not set')

0 commit comments

Comments
 (0)