[PATCH 4/5] Make anaconda+python3+pocketlint work.
Chris Lumens
clumens at redhat.com
Thu Jun 4 17:16:03 UTC 2015
This involves tweaking the false positives a bit and then making several very
small changes throughout.
---
pyanaconda/rescue.py | 4 ++--
pyanaconda/simpleconfig.py | 2 +-
pyanaconda/ui/common.py | 2 +-
pyanaconda/ui/gui/spokes/source.py | 2 ++
pyanaconda/ui/tui/simpleline/base.py | 1 -
scripts/merge-pr | 2 +-
tests/pylint/runpylint.py | 15 ++++++++-------
7 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/pyanaconda/rescue.py b/pyanaconda/rescue.py
index 42ca0d8..2d0e61e 100644
--- a/pyanaconda/rescue.py
+++ b/pyanaconda/rescue.py
@@ -175,7 +175,7 @@ def runShell(screen=None, msg=""):
if screen:
screen.suspend()
- print
+ print()
if msg:
print(msg)
@@ -185,7 +185,7 @@ def runShell(screen=None, msg=""):
else:
print(_("When finished please exit from the shell and your "
"system will reboot."))
- print
+ print()
proc = None
diff --git a/pyanaconda/simpleconfig.py b/pyanaconda/simpleconfig.py
index 5de9ea7..371e6ac 100644
--- a/pyanaconda/simpleconfig.py
+++ b/pyanaconda/simpleconfig.py
@@ -25,7 +25,7 @@
import os
import shutil
import shlex
-import string
+import string # pylint: disable=deprecated-module
import tempfile
from pyanaconda.iutil import upperASCII, eintr_retry_call
diff --git a/pyanaconda/ui/common.py b/pyanaconda/ui/common.py
index 7134dff..5c128d5 100644
--- a/pyanaconda/ui/common.py
+++ b/pyanaconda/ui/common.py
@@ -671,7 +671,7 @@ def collect(module_pattern, path, pred):
for name in module.__all__
if p(getattr(module, name))]
- for (name, val) in members:
+ for (_name, val) in members:
retval.append(val)
return retval
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 5b76d0b..ed259a3 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -369,6 +369,8 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler):
self._proxyChange = False
self._cdrom = None
+ self._repoChecks = {}
+
def apply(self):
# If askmethod was provided on the command line, entering the source
# spoke wipes that out.
diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index c70ccbf..c8efcfd 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -26,7 +26,6 @@ import queue
import getpass
import threading
import functools
-import queue
from pyanaconda.threads import threadMgr, AnacondaThread
from pyanaconda.ui.communication import hubQ
from pyanaconda import constants, iutil
diff --git a/scripts/merge-pr b/scripts/merge-pr
index a307334..c951aea 100755
--- a/scripts/merge-pr
+++ b/scripts/merge-pr
@@ -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 = input("Input 2-factor authentication code: ")
except EOFError:
twofactor = ""
diff --git a/tests/pylint/runpylint.py b/tests/pylint/runpylint.py
index 4e36d4b..8be3be2 100755
--- a/tests/pylint/runpylint.py
+++ b/tests/pylint/runpylint.py
@@ -6,13 +6,14 @@ from pocketlint import FalsePositive, PocketLintConfig, PocketLinter
class AnacondaLintConfig(PocketLintConfig):
def __init__(self):
- self.falsePositives = [ FalsePositive(r"^E1101:[ 0-9]*,[0-9]*:.*: Instance of '.*' has no 'get_property' member$"),
- FalsePositive(r"^E1101:[ 0-9]*,[0-9]*:.*: Instance of '.*' has no 'set_property' member$"),
- FalsePositive(r"^E0611:[ 0-9]*,[0-9]*: No name '_isys' in module 'pyanaconda'$"),
- FalsePositive(r"^E0611:[ 0-9]*,[0-9]*:.*: No name '_isys' in module 'pyanaconda'$"),
- FalsePositive(r"^E0712:[ 0-9]*,[0-9]*:.*: Catching an exception which doesn't inherit from BaseException: GError$"),
- FalsePositive(r"gi/module.py:[0-9]*: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed$"),
- FalsePositive(r"^ g_type = info\.get_g_type\(\)$")
+ PocketLintConfig.__init__(self)
+
+ self.falsePositives = [ FalsePositive(r"^E0611.*: No name '_isys' in module 'pyanaconda'$"),
+ FalsePositive(r"^E0712.*: Catching an exception which doesn't inherit from BaseException: GError$"),
+
+ # XXX: These are temporary until dogtail and koji have python3 versions.
+ FalsePositive(r"^F0401.*: Unable to import 'dogtail.*'$"),
+ FalsePositive(r"^F0401.*: Unable to import 'koji'$")
]
@property
--
2.2.2
More information about the anaconda-patches
mailing list