Skip to content

Commit 2cdc9dd

Browse files
committed
[PR #3815] change per reveiw: drop unneeded try block in Python node
Signed-off-by: Mats Wichmann <[email protected]>
1 parent 60dfff8 commit 2cdc9dd

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
6363
- Make sure cProfile is used if profiling - SCons was expecting
6464
the Util module to monkeypatch in cProfile as profile if available,
6565
but this is no longer being done.
66-
- Some Python 2 compat dropped
66+
- Some Python 2 compatibility code dropped
6767

6868
From Simon Tegelid
6969
- Fix using TEMPFILE in multiple actions in an action list. Previously a builder, or command

SCons/Node/Python.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,14 @@ def get_text_contents(self) -> str:
143143

144144
def get_contents(self) -> bytes:
145145
"""Get contents for signature calculations."""
146-
text_contents = self.get_text_contents()
147-
try:
148-
return text_contents.encode()
149-
except AttributeError:
150-
# Should not happen, as get_text_contents returns str
151-
return text_contents
146+
return self.get_text_contents().encode()
152147

153148
def changed_since_last_build(self, target, prev_ni):
154149
cur_csig = self.get_csig()
155150
try:
156151
return cur_csig != prev_ni.csig
157152
except AttributeError:
158-
return 1
153+
return True
159154

160155
def get_csig(self, calc=None):
161156
"""Because we're a Python value node and don't have a real

0 commit comments

Comments
 (0)