Add some comments, which will allow to easier find code, which should be
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Thu, 25 Aug 2011 21:35:48 +0000 (23:35 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Thu, 25 Aug 2011 21:35:48 +0000 (23:35 +0200)
removed when support for older versions of Python is removed.

pym/_emerge/PipeReader.py
pym/_emerge/SpawnProcess.py
pym/portage/tests/ebuild/test_array_fromfile_eof.py
pym/portage/util/_pty.py
pym/portage/xml/metadata.py
pym/portage/xpak.py

index 02e550dce27059498d33254cef40f09626f53fff..888c60963e8733b330ec97f20550344eebdbc291 100644 (file)
@@ -71,6 +71,7 @@ class PipeReader(AbstractPollTask):
 
                        if buf:
                                try:
+                                       # Python >=3.2
                                        data = buf.tobytes()
                                except AttributeError:
                                        data = buf.tostring()
index aa4160572a1270df713fe2255d6c32e253397c1a..099407eda8292bc71d7e98e4a5272585f94cdc54 100644 (file)
@@ -207,6 +207,7 @@ class SpawnProcess(SubProcess):
                                except TypeError:
                                        # array.tofile() doesn't work with GzipFile
                                        try:
+                                               # Python >=3.2
                                                data = buf.tobytes()
                                        except AttributeError:
                                                data = buf.tostring()
index f965b838484e178de688d9654c39fd313ca82986..efcd9156f83bf8ab1b11798e646f5024bd6adb84 100644 (file)
@@ -36,6 +36,7 @@ class ArrayFromfileEofTestCase(TestCase):
                                eof = True
                        else:
                                try:
+                                       # Python >=3.2
                                        data.append(a.tobytes())
                                except AttributeError:
                                        data.append(a.tostring())
index f308ccbce88211287981dafd26c4b898a5da096d..af0fc9d8afa157d174a085a18b08e3c7abb7d997 100644 (file)
@@ -113,6 +113,7 @@ def _test_pty_eof(fdopen_buffered=False):
                        eof = True
                else:
                        try:
+                               # Python >=3.2
                                data.append(buf.tobytes())
                        except AttributeError:
                                data.append(buf.tostring())
index 090d2c0b35ca8edab0959e174f0db4fb16f46fdd..ade2cff818f179e85765de07e406be9312ed6d2d 100644 (file)
@@ -218,6 +218,7 @@ class MetaDataXML(object):
                        return None
 
                try:
+                       # Python 2.7 or >=3.2
                        iterate = self._herdstree.iter
                except AttributeError:
                        iterate = self._herdstree.getiterator
@@ -298,6 +299,7 @@ class MetaDataXML(object):
                                self._useflags = tuple()
                        else:
                                try:
+                                       # Python 2.7 or >=3.2
                                        iterate = self._xml_tree.iter
                                except AttributeError:
                                        iterate = self._xml_tree.getiterator
index b13e257dcb09dcde3956c5579822e1ba8e45641d..01cfe7b0a6745d7536c8523477e1aa661c1ff682 100644 (file)
@@ -67,6 +67,7 @@ def encodeint(myint):
        a.append((myint >> 8 ) & 0xff)
        a.append(myint & 0xff)
        try:
+               # Python >=3.2
                return a.tobytes()
        except AttributeError:
                return a.tostring()