commit: aabb88312cb2e07a1a48b9017dda4012696b867c Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org> AuthorDate: Wed May 14 19:24:59 2014 +0000 Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> 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):