aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-10-29 16:21:41 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-10-30 22:01:30 +0100
commit5182542126a5ad3c40d958b0b72cfa16f4e8bd25 (patch)
treed26bfee9fa5d0fca1810a8650e62dc5f16744d3a /tools/shared.py
parent350550a5ccfacd19f512bca2ded186e143ea9579 (diff)
tools: parse pre-release node.js version numbers
`node` binaries built from upstream git have a "-pre" suffix attached to the version number. Fix the version parser to handle those.
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 108a48a4..f6c0cc95 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -284,7 +284,7 @@ def check_node_version():
try:
node = listify(NODE_JS)
actual = Popen(node + ['--version'], stdout=PIPE).communicate()[0].strip()
- version = tuple(map(int, actual.replace('v', '').split('.')))
+ version = tuple(map(int, actual.replace('v', '').replace('-pre', '').split('.')))
if version >= EXPECTED_NODE_VERSION:
return True
logging.warning('node version appears too old (seeing "%s", expected "%s")' % (actual, 'v' + ('.'.join(map(str, EXPECTED_NODE_VERSION)))))