diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 05:46:21 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 05:46:21 +0000 |
commit | c35e82e2fb78f9c05cf0011454cf413c41ed9349 (patch) | |
tree | 2bb6ddd9668cea087c42c6c4177bd23a9824e2a2 /pym/_emerge | |
parent | fc2e5227451c6a4838bc26e85792c9e247627d69 (diff) | |
download | portage-c35e82e2fb78f9c05cf0011454cf413c41ed9349.tar.gz portage-c35e82e2fb78f9c05cf0011454cf413c41ed9349.tar.bz2 portage-c35e82e2fb78f9c05cf0011454cf413c41ed9349.zip |
For compatibility with python-3.0, use isinstance() instead of type().
(trunk r12633)
svn path=/main/branches/2.1.6/; revision=12906
Diffstat (limited to 'pym/_emerge')
-rw-r--r-- | pym/_emerge/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index fc82468ff..86bdd706d 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -32,7 +32,7 @@ from portage import digraph from portage.const import NEWS_LIB_PATH import _emerge.help -import portage.xpak, commands, errno, re, socket, time, types +import portage.xpak, commands, errno, re, socket, time from portage.output import blue, bold, colorize, darkblue, darkgreen, darkred, green, \ nc_len, red, teal, turquoise, xtermTitle, \ xtermTitleReset, yellow @@ -277,8 +277,8 @@ def countdown(secs=5, doing="Starting"): # formats a size given in bytes nicely def format_size(mysize): - if type(mysize) not in [types.IntType,types.LongType]: - return str(mysize) + if isinstance(mysize, basestring): + return mysize if 0 != mysize % 1024: # Always round up to the next kB so that it doesn't show 0 kB when # some small file still needs to be fetched. |