Open the temp file in text mode for py3k compatibility.
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Feb 2009 04:11:03 +0000 (04:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Feb 2009 04:11:03 +0000 (04:11 -0000)
svn path=/main/trunk/; revision=12726

pym/portage/tests/news/test_NewsItem.py

index f6c59e6a223cd2cf88958b307e7dbcf8810381dd..f4a0735047aa44a86da64926cf935a5a289ea824 100644 (file)
@@ -56,8 +56,8 @@ The revdep-rebuild tool is provided by app-portage/gentoolkit.
                tmpItem = self.fakeItem[:].replace("#Display-If-Profile:", "Display-If-Profile: %s" %
                        self.profile)
 
+               item = self._processItem(tmpItem)
                try:
-                       item = self._processItem(tmpItem)
                        self.assertTrue(item.isRelevant(self.vardb, self.settings, self.profile),
                                msg="Expected %s to be relevant, but it was not!" % tmpItem)
                finally:
@@ -88,9 +88,9 @@ The revdep-rebuild tool is provided by app-portage/gentoolkit.
        def _processItem(self, item):
                filename = None
                fd, filename = mkstemp()
-               f = os.fdopen(fd, 'wb')
+               f = os.fdopen(fd, 'w')
                f.write(item)
-               f.close
+               f.close()
                try:
                        return NewsItem(filename, 0)
                except TypeError: