diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-08-24 22:19:14 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-08-24 22:19:14 (GMT) |
commit | ecb0e776746503141b7a1b970256e380156739d7 (patch) | |
tree | bd18b91becf2d7db700eca20cb18c042a4044e8a | |
parent | c0267abfae58e329ecb622ffe9853716e575e701 (diff) | |
download | SCons-ecb0e776746503141b7a1b970256e380156739d7.zip SCons-ecb0e776746503141b7a1b970256e380156739d7.tar.gz SCons-ecb0e776746503141b7a1b970256e380156739d7.tar.bz2 |
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 0409d3b..e186752 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 5f99054..77269a8 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: |