[PATCH 12/11] Fix a few miscellaneous pylint-caught problems.
Chris Lumens
clumens at redhat.com
Mon Apr 27 17:09:10 UTC 2015
(1) Replace a use of filter with a list comprehension, because the former was
resulting in some weird errors from pylint.
(2) We're using print as a function everywhere else in makebumpver, so do the
same when we just want to print out a newline.
(3) raw_input in python3 has been renamed to input, so use six to figure that
out for us.
---
scripts/makebumpver | 4 ++--
scripts/merge-pr | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/makebumpver b/scripts/makebumpver
index 9e87fc6..72714dd 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -130,7 +130,7 @@ class MakeBumpVer:
elif len(ret) == 1:
ret = ret[0]
else:
- ret = filter(lambda x: x != '', ret)
+ ret = [r for r in ret if r != '']
return ret
@@ -148,7 +148,7 @@ class MakeBumpVer:
bzclass = bugzilla.Bugzilla
self.bz = bzclass(url=self.bzurl)
- print
+ print()
if not self.bz.logged_in:
rc = self.bz.login(self.username, self.password)
diff --git a/scripts/merge-pr b/scripts/merge-pr
index a307334..7b13939 100755
--- a/scripts/merge-pr
+++ b/scripts/merge-pr
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python
#
# merge-pr - Rebase, merge, and close a github pull request
#
@@ -73,7 +73,7 @@ def talk_to_github(request):
if response.status_code in (401, 404) and \
response.headers.get('X-GitHub-OTP', '').startswith('required'):
try:
- twofactor = raw_input("Input 2-factor authentication code: ")
+ twofactor = six.moves.input("Input 2-factor authentication code: ")
except EOFError:
twofactor = ""
--
2.2.2
More information about the anaconda-patches
mailing list