From f8dbe9cbc14ee163b9c3d42045a6902169af99ea Mon Sep 17 00:00:00 2001 From: peter-pycom <61411318+peter-pycom@users.noreply.github.com> Date: Thu, 6 May 2021 13:18:37 +0200 Subject: [PATCH] pygate: close config file to save ram e.g. on 1.20.3.b3 on a wipy this makes the difference between immediate out of memory or able to start --- content/tutorials/expansionboards/pygate.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/tutorials/expansionboards/pygate.md b/content/tutorials/expansionboards/pygate.md index 9ad9416..d086121 100644 --- a/content/tutorials/expansionboards/pygate.md +++ b/content/tutorials/expansionboards/pygate.md @@ -100,8 +100,8 @@ while not rtc.synced(): print(" OK\n") # Read the GW config file from Filesystem -fp = open('/flash/config.json','r') -buf = fp.read() +with open('/flash/config.json','r') as fp: + buf = fp.read() # Start the Pygate machine.pygate_init(buf)