[elbe-devel] [PATCH 17/40] pylint: rework redefinition of variable 'type'
Manuel Traut
manut at linutronix.de
Fri Sep 14 13:56:29 CEST 2018
avoid redefinition by not setting variables outside if/else statements
Signed-off-by: Manuel Traut <manut at linutronix.de>
---
elbepack/elbeproject.py | 4 +++-
elbepack/xmlpreprocess.py | 5 +++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 0f29695a..1e2b0287 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -422,9 +422,11 @@ class ElbeProject (object):
self.write_log_header()
# Validate Apt Sources
- m = ValidationMode.CHECK_BINARIES
if build_sources:
m = ValidationMode.CHECK_ALL
+ else:
+ m = ValidationMode.CHECK_BINARIES
+
self.xml.validate_apt_sources(m, self.arch)
if self.xml.has('target/pbuilder') and not skip_pbuild:
diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
index 39185ceb..e1456b4d 100644
--- a/elbepack/xmlpreprocess.py
+++ b/elbepack/xmlpreprocess.py
@@ -27,8 +27,9 @@ def xmlpreprocess(fname, output, variants=None):
# first convert variants to a set
if not variants:
- variants = []
- variants = set(variants)
+ variants = set([])
+ else:
+ variants = set(variants)
schema_file = "https://www.linutronix.de/projects/Elbe/dbsfed.xsd"
parser = XMLParser(huge_tree=True)
--
2.19.0.rc2
More information about the elbe-devel
mailing list