summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2011-08-25 23:35:48 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2011-08-25 23:35:48 +0200
commit48f340f78ef75efe8813045b9a75aa9839b89690 (patch)
treeec194489527e1f57b87f646f8291298f1d2c047a
parent5970a41fc60fef89fd4b1bbe45a6c108452b267f (diff)
downloadportage-48f340f78ef75efe8813045b9a75aa9839b89690.tar.gz
portage-48f340f78ef75efe8813045b9a75aa9839b89690.tar.bz2
portage-48f340f78ef75efe8813045b9a75aa9839b89690.zip
Add some comments, which will allow to easier find code, which should be
removed when support for older versions of Python is removed.
-rw-r--r--pym/_emerge/PipeReader.py1
-rw-r--r--pym/_emerge/SpawnProcess.py1
-rw-r--r--pym/portage/tests/ebuild/test_array_fromfile_eof.py1
-rw-r--r--pym/portage/util/_pty.py1
-rw-r--r--pym/portage/xml/metadata.py2
-rw-r--r--pym/portage/xpak.py1
6 files changed, 7 insertions, 0 deletions
diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 02e550dce..888c60963 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -71,6 +71,7 @@ class PipeReader(AbstractPollTask):
if buf:
try:
+ # Python >=3.2
data = buf.tobytes()
except AttributeError:
data = buf.tostring()
diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index aa4160572..099407eda 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -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()
diff --git a/pym/portage/tests/ebuild/test_array_fromfile_eof.py b/pym/portage/tests/ebuild/test_array_fromfile_eof.py
index f965b8384..efcd9156f 100644
--- a/pym/portage/tests/ebuild/test_array_fromfile_eof.py
+++ b/pym/portage/tests/ebuild/test_array_fromfile_eof.py
@@ -36,6 +36,7 @@ class ArrayFromfileEofTestCase(TestCase):
eof = True
else:
try:
+ # Python >=3.2
data.append(a.tobytes())
except AttributeError:
data.append(a.tostring())
diff --git a/pym/portage/util/_pty.py b/pym/portage/util/_pty.py
index f308ccbce..af0fc9d8a 100644
--- a/pym/portage/util/_pty.py
+++ b/pym/portage/util/_pty.py
@@ -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())
diff --git a/pym/portage/xml/metadata.py b/pym/portage/xml/metadata.py
index 090d2c0b3..ade2cff81 100644
--- a/pym/portage/xml/metadata.py
+++ b/pym/portage/xml/metadata.py
@@ -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
diff --git a/pym/portage/xpak.py b/pym/portage/xpak.py
index b13e257dc..01cfe7b0a 100644
--- a/pym/portage/xpak.py
+++ b/pym/portage/xpak.py
@@ -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()