Code simplifications

This commit is contained in:
Thomas Nagy 2017-04-22 22:12:11 +02:00
parent 1a876716cb
commit 008c9016a8
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
4 changed files with 4 additions and 4 deletions

View File

@ -244,7 +244,7 @@ def add_settings_enums(self, namespace, filename_list):
raise Errors.WafError("Tried to add gsettings enums to %r more than once" % self.name) raise Errors.WafError("Tried to add gsettings enums to %r more than once" % self.name)
self.settings_enum_namespace = namespace self.settings_enum_namespace = namespace
if type(filename_list) != 'list': if not isinstance(filename_list, list):
filename_list = [filename_list] filename_list = [filename_list]
self.settings_enum_files = filename_list self.settings_enum_files = filename_list

View File

@ -230,6 +230,7 @@ class XMLHandler(ContentHandler):
Parses ``.qrc`` files Parses ``.qrc`` files
""" """
def __init__(self): def __init__(self):
ContentHandler.__init__(self)
self.buf = [] self.buf = []
self.files = [] self.files = []
def startElement(self, name, attrs): def startElement(self, name, attrs):
@ -455,7 +456,6 @@ def configure(self):
self.fatal('Could not build a simple Qt application') self.fatal('Could not build a simple Qt application')
# FreeBSD does not add /usr/local/lib and the pkg-config files do not provide it either :-/ # FreeBSD does not add /usr/local/lib and the pkg-config files do not provide it either :-/
from waflib import Utils
if Utils.unversioned_sys_platform() == 'freebsd': if Utils.unversioned_sys_platform() == 'freebsd':
frag = '#include <QApplication>\nint main(int argc, char **argv) { QApplication app(argc, argv); return NULL != (void*) (&app);}\n' frag = '#include <QApplication>\nint main(int argc, char **argv) { QApplication app(argc, argv); return NULL != (void*) (&app);}\n'
try: try:

View File

@ -28,7 +28,7 @@ else:
try: try:
TimeoutExpired = subprocess.TimeoutExpired TimeoutExpired = subprocess.TimeoutExpired
except AttributeError: except AttributeError:
class TimeoutExpired(object): class TimeoutExpired(Exception):
pass pass
from collections import deque, defaultdict from collections import deque, defaultdict

View File

@ -16,7 +16,7 @@ except ImportError:
try: try:
TimeoutExpired = subprocess.TimeoutExpired TimeoutExpired = subprocess.TimeoutExpired
except AttributeError: except AttributeError:
class TimeoutExpired(object): class TimeoutExpired(Exception):
pass pass
def run(): def run():