From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (unknown [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A636E1381FA for ; Wed, 14 May 2014 23:49:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E811E0A76; Wed, 14 May 2014 23:49:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 96CE7E0A86 for ; Wed, 14 May 2014 23:49:55 +0000 (UTC) Received: from spoonbill.gentoo.org (unknown [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AC26733FF54 for ; Wed, 14 May 2014 23:49:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 489AE182D9 for ; Wed, 14 May 2014 23:49:52 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1400111231.aabb88312cb2e07a1a48b9017dda4012696b867c.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:gsoc2014 commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/api.py X-VCS-Directories: layman/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: aabb88312cb2e07a1a48b9017dda4012696b867c X-VCS-Branch: gsoc2014 Date: Wed, 14 May 2014 23:49:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 95c5b64d-350f-4645-a83e-a93c4d5de6e1 X-Archives-Hash: f15b1c46e1a65bbcda30af59563f0aff commit: aabb88312cb2e07a1a48b9017dda4012696b867c Author: Devan Franchini gentoo org> AuthorDate: Wed May 14 19:24:59 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Wed May 14 23:47:11 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=aabb8831 layman/api.py: Corrects output of repos and stderr Due to repos coming in as a binary string, it needed to be converted to a normal string before joining it in the debug message or it will cause runtime failures. Due to 2to3 overlooking the print statement on line 513, this has also been corrected along with a check to see if the repos variable is an instance of type str instead of type basestring which is no longer available in py3. --- layman/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layman/api.py b/layman/api.py index f36be0a..763050d 100755 --- a/layman/api.py +++ b/layman/api.py @@ -90,7 +90,7 @@ class LaymanAPI(object): converting a string to a list[string] if it is not already a list. produces and error message if it is any other type returns repos as list always""" - if isinstance(repos, basestring): + if isinstance(repos, str): repos = [repos] # else assume it is an iterable, if not it will error return [encode(i) for i in repos] @@ -299,7 +299,7 @@ class LaymanAPI(object): @param update_news: bool, defaults to False @rtype bool or {'repo-id': bool,...} """ - self.output.debug("API.sync(); repos to sync = %s" % ', '.join(repos), 5) + self.output.debug("API.sync(); repos to sync = %s" % ', '.join(str(repos)), 5) fatals = [] warnings = [] success = [] @@ -513,7 +513,7 @@ class LaymanAPI(object): self._error_messages.append(message) self.output.debug("API._error(); _error_messages = %s" % str(self._error_messages), 4) if self.report_errors: - print >>self.config['stderr'], message + print(message, file=self.config['stderr']) def get_errors(self):