X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fnetns%2Fnetnswrapper_debug.py;h=462b7308905e7264a4f37399c77f29d539e0b483;hb=cb5d027b813a27d7de263653e1a8e0cef5490f0a;hp=7818a8e6c9ff21b53b82c93b012a9035c5cc2c16;hpb=741b99fe027fe6b54846a0703d26510d9b40a135;p=nepi.git diff --git a/src/nepi/resources/netns/netnswrapper_debug.py b/src/nepi/resources/netns/netnswrapper_debug.py index 7818a8e6..462b7308 100644 --- a/src/nepi/resources/netns/netnswrapper_debug.py +++ b/src/nepi/resources/netns/netnswrapper_debug.py @@ -3,9 +3,8 @@ # Copyright (C) 2013 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -47,9 +46,8 @@ class NetNSWrapperDebuger(object): return self._script_path def dump_to_script(self, command): - f = open(self.script_path, "a") - f.write("%s" % command) - f.close() + with open(self.script_path, "a") as f: + f.write("%s" % command) def dump_header(self): if not self.enabled: