public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/_emerge/
Date: Fri, 28 Oct 2011 20:13:16 +0000 (UTC)	[thread overview]
Message-ID: <e8da78af846bac21363c85d4bee5d938844843be.zmedico@gentoo> (raw)

commit:     e8da78af846bac21363c85d4bee5d938844843be
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 20:13:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 20:13:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e8da78af

Check for bytes instead of unicode in args.

This simplifies the checks since the bytes type is available in all
supported python versions, while the unicode type is only available in
python2.

---
 bin/lock-helper.py  |    4 ++--
 bin/portageq        |    2 +-
 pym/_emerge/main.py |    3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/lock-helper.py b/bin/lock-helper.py
index 5f3ea9f..065ddcb 100755
--- a/bin/lock-helper.py
+++ b/bin/lock-helper.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import os
@@ -9,7 +9,7 @@ import portage
 
 def main(args):
 
-	if args and sys.hexversion < 0x3000000 and not isinstance(args[0], unicode):
+	if args and isinstance(args[0], bytes):
 		for i, x in enumerate(args):
 			args[i] = portage._unicode_decode(x, errors='strict')
 

diff --git a/bin/portageq b/bin/portageq
index 02f1904..40cc21d 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -847,7 +847,7 @@ def main():
 		os.environ["ROOT"] = root
 
 	args = sys.argv[2:]
-	if args and sys.hexversion < 0x3000000 and not isinstance(args[0], unicode):
+	if args and isinstance(args[0], bytes):
 		for i in range(len(args)):
 			args[i] = portage._unicode_decode(args[i])
 

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 0dfc5f9..162f70f 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1233,8 +1233,7 @@ def parse_opts(tmpcmdline, silent=False):
 	if myaction is None and myoptions.deselect is True:
 		myaction = 'deselect'
 
-	if myargs and sys.hexversion < 0x3000000 and \
-		not isinstance(myargs[0], unicode):
+	if myargs and isinstance(myargs[0], bytes):
 		for i in range(len(myargs)):
 			myargs[i] = portage._unicode_decode(myargs[i])
 



             reply	other threads:[~2011-10-28 20:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 20:13 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-30 19:28 [gentoo-commits] proj/portage:master commit in: bin/, pym/_emerge/ Zac Medico
2018-03-28  6:52 Zac Medico
2015-09-28 16:08 Zac Medico
2013-12-27 18:06 Arfrever Frehtes Taifersar Arahesis
2013-08-03  0:38 Zac Medico
2012-12-29  7:45 Zac Medico
2012-10-14 21:59 Zac Medico
2012-10-06 18:11 Zac Medico
2012-10-06 18:05 Zac Medico
2012-09-15 16:53 Zac Medico
2012-07-18 21:38 Zac Medico
2012-03-25 23:20 Zac Medico
2011-12-10  3:23 Zac Medico
2011-10-29  3:20 Zac Medico
2011-02-22  2:51 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8da78af846bac21363c85d4bee5d938844843be.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox