[PATCH 2/4] Make it possible to specify file open mode
Martin Kolman
mkolman at redhat.com
Mon Mar 30 13:38:26 UTC 2015
This is sometimes needed for Python 2 + 3 compatibility.
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
tests/baseclass.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/baseclass.py b/tests/baseclass.py
index 5fc5c36..c8edc64 100644
--- a/tests/baseclass.py
+++ b/tests/baseclass.py
@@ -17,9 +17,9 @@ class BaseTestCase(unittest.TestCase):
dump = ExceptionDump(ExceptionInfo(None, None, stack), conf)
return dump.dump(obj)
- def openFile(self):
+ def openFile(self, mode="w"):
(fd, path) = tempfile.mkstemp()
- fo = os.fdopen(fd, "w")
+ fo = os.fdopen(fd, mode)
return (fo, path)
def tracebackContains(self, path, str):
--
2.1.0
More information about the anaconda-patches
mailing list