File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11
11
12
12
13
13
IS_WIN = os .name == 'nt'
14
- IS_DARWIN = (sys .platform == 'darwin' )
15
14
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.
18
17
PORT = ctx .node .properties ['port' ]
19
18
20
19
@@ -26,8 +25,8 @@ def run_server():
26
25
# The ctx object provides a built in logger.
27
26
ctx .logger .info ('Running WebServer locally on port: {0}' .format (PORT ))
28
27
# 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 )
31
30
return process .pid
32
31
33
32
You can’t perform that action at this time.
0 commit comments