diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-08-24 15:19:14 -0700 |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-08-24 15:19:14 -0700 |
commit | a0a0d8c6e521866d1ada7c1774f74f09e8da70c3 (patch) | |
tree | bd18b91becf2d7db700eca20cb18c042a4044e8a | |
parent | 40ad766db88a95ca1826e980689bbb9da9fee248 (diff) | |
download | scons-a0a0d8c6e521866d1ada7c1774f74f09e8da70c3.tar.gz |
PY2/3 get_contents() was returning empty string instead of empty bytes when file doesn't exist. get_text_contents() was then trying to call decode on a string object... Fixed. get_contents() now returns empty byte string
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/qt.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 0409d3b2..e1867522 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -211,7 +211,7 @@ def get_contents_dir(node): def get_contents_file(node): if not node.rexists(): - return '' + return b'' fname = node.rfile().get_abspath() try: with open(fname, "rb") as fp: diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py index 5f99054f..77269a83 100644 --- a/src/engine/SCons/Tool/qt.py +++ b/src/engine/SCons/Tool/qt.py @@ -144,6 +144,8 @@ class _Automoc(object): # c or fortran source continue #cpp_contents = comment.sub('', cpp.get_text_contents()) + if debug: + print("scons: qt: Getting contents of %s" % cpp) cpp_contents = cpp.get_text_contents() h=None for h_ext in header_extensions: |