summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:54:23 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:54:23 +0200
commitc2d9eaeffe9d77d8d5087fb21a3256fde32047d4 (patch)
tree144aeb4702d258b0cfaf99cffb9f21e94b026459 /site_scons
parent6ca68f29862bc7cbe5428426eee600cb1f3c05c1 (diff)
parentefdf3fdbcd2f7654cb8d1209a8b040914437bacd (diff)
Update upstream source from tag 'upstream/3.1.0'
Update to upstream version '3.1.0' with Debian dir e69b7671114411c368722827d87d86b44ed7cd40
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/soe_utils.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/site_scons/soe_utils.py b/site_scons/soe_utils.py
index 451c7de..3b87dee 100644
--- a/site_scons/soe_utils.py
+++ b/site_scons/soe_utils.py
@@ -17,16 +17,14 @@ def soelim(target, source, env):
t = str(target[0])
s = str(source[0])
dir, f = os.path.split(s)
- tfp = open(t, 'w')
- sfp = open(s, 'r')
- for line in sfp.readlines():
- if line[:4] in ['.so ', "'so "]:
- sofile = os.path.join(dir, line[4:-1])
- tfp.write(open(sofile, 'r').read())
- else:
- tfp.write(line)
- sfp.close()
- tfp.close()
+ with open(t, 'w') as tfp, open(s, 'r') as sfp:
+ for line in sfp.readlines():
+ if line[:4] in ['.so ', "'so "]:
+ sofile = os.path.join(dir, line[4:-1])
+ with open(sofile, 'r') as f:
+ tfp.write(f.read())
+ else:
+ tfp.write(line)
def soscan(node, env, path):
c = node.get_text_contents()