Code simplifications

This commit is contained in:
Thomas Nagy 2017-04-22 22:12:11 +02:00
parent 8c32fade86
commit fbdc9fd5a3
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)
self.settings_enum_namespace = namespace
if type(filename_list) != 'list':
if not isinstance(filename_list, list):
filename_list = [filename_list]
self.settings_enum_files = filename_list

View File

@ -230,6 +230,7 @@ class XMLHandler(ContentHandler):
Parses ``.qrc`` files
"""
def __init__(self):
ContentHandler.__init__(self)
self.buf = []
self.files = []
def startElement(self, name, attrs):
@ -455,7 +456,6 @@ def configure(self):
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 :-/
from waflib import Utils
if Utils.unversioned_sys_platform() == 'freebsd':
frag = '#include <QApplication>\nint main(int argc, char **argv) { QApplication app(argc, argv); return NULL != (void*) (&app);}\n'
try:

View File

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

View File

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