Skip to content

Commit 7e9fcb7

Browse files
committed
optimizations
1 parent f3b03f4 commit 7e9fcb7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

install.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111

1212

1313
IS_WIN = os.name == 'nt'
14-
IS_DARWIN = (sys.platform == 'darwin')
1514

16-
# Get the port from the blueprint. We're running in the context of the
17-
# `http_web_server` node so we can read its `port` property.
15+
# Get the port from the blueprint. We're running this script in the context of
16+
# the `http_web_server` node so we can read its `port` property.
1817
PORT = ctx.node.properties['port']
1918

2019

@@ -26,8 +25,8 @@ def run_server():
2625
# The ctx object provides a built in logger.
2726
ctx.logger.info('Running WebServer locally on port: {0}'.format(PORT))
2827
# emulating /dev/null
29-
dn = open(os.devnull, 'wb')
30-
process = subprocess.Popen(webserver_cmd, stdout=dn, stderr=dn)
28+
with open(os.devnull, 'wb') as dn:
29+
process = subprocess.Popen(webserver_cmd, stdout=dn, stderr=dn)
3130
return process.pid
3231

3332

0 commit comments

Comments
 (0)