File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212
1313IS_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.
1817PORT = 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
You can’t perform that action at this time.
0 commit comments