diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-02-18 18:32:23 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2020-02-18 18:32:23 (GMT) |
commit | b3589ce0a14ca9cc3ac67ee5d1a2d6ff92d4c6b0 (patch) | |
tree | 46f26f33320e683d2229e45c9955605d51d64507 /src/engine | |
parent | 987f563b8cd16f146c2ee8b8f1617d8954aab810 (diff) | |
download | SCons-b3589ce0a14ca9cc3ac67ee5d1a2d6ff92d4c6b0.zip SCons-b3589ce0a14ca9cc3ac67ee5d1a2d6ff92d4c6b0.tar.gz SCons-b3589ce0a14ca9cc3ac67ee5d1a2d6ff92d4c6b0.tar.bz2 |
Remove u' u" from strings. no longer needed
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Action.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Environment.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/JobTests.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 22 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/ScannerTests.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Taskmaster.py | 24 | ||||
-rw-r--r-- | src/engine/SCons/UtilTests.py | 2 |
9 files changed, 24 insertions, 41 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index b22de60..0b7282c 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -669,7 +669,7 @@ class _ActionAction(ActionBase): source = executor.get_all_sources() t = ' and '.join(map(str, target)) l = '\n '.join(self.presub_lines(env)) - out = u"Building %s with action:\n %s\n" % (t, l) + out = "Building %s with action:\n %s\n" % (t, l) sys.stdout.write(out) cmd = None if show and self.strfunction: diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 5e76e35..00379e1 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -584,7 +584,7 @@ class SubstitutionEnvironment(object): out,err = p.communicate() status = p.wait() if err: - sys.stderr.write(u"" + err) + sys.stderr.write("" + err) if status: raise OSError("'%s' exited %d" % (command, status)) return out diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 3db6499..a9ec674 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -262,11 +262,6 @@ class SubstitutionTestCase(unittest.TestCase): assert isinstance(nodes[0], X) assert nodes[0].name == "Util.py UtilTests.py", nodes[0].name - nodes = env.arg2nodes(u"Util.py UtilTests.py", Factory) - assert len(nodes) == 1, nodes - assert isinstance(nodes[0], X) - assert nodes[0].name == u"Util.py UtilTests.py", nodes[0].name - nodes = env.arg2nodes(["Util.py", "UtilTests.py"], Factory) assert len(nodes) == 2, nodes assert isinstance(nodes[0], X) diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index 2e3af4f..9c9bb41 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -42,8 +42,8 @@ def get_cpu_nums(): ncpus = os.sysconf( "SC_NPROCESSORS_ONLN" ) if isinstance(ncpus, int) and ncpus > 0: return ncpus - else: # OSX: - return int( os.popen2( "sysctl -n hw.ncpu")[1].read() ) + else: # OSX: + return int(os.popen2("sysctl -n hw.ncpu")[1].read() ) # Windows: if "NUMBER_OF_PROCESSORS" in os.environ: ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 1a5bd1b..bb965db 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -3727,7 +3727,7 @@ class FileFinder(object): if verbose and not callable(verbose): if not SCons.Util.is_String(verbose): verbose = "find_file" - _verbose = u' %s: ' % verbose + _verbose = ' %s: ' % verbose verbose = lambda s: sys.stdout.write(_verbose + s) filedir, filename = os.path.split(filename) diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 26c71b0..3f2cb0e 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -1342,11 +1342,10 @@ class FSTestCase(_tempdirTestCase): assert f1.get_contents() == bytearray("Foo\x1aBar", 'utf-8'), f1.get_contents() # This tests to make sure we can decode UTF-8 text files. - test_string = u"Foo\x1aBar" + test_string = "Foo\x1aBar" test.write("utf8_file", test_string.encode('utf-8')) f1 = fs.File(test.workpath("utf8_file")) - assert eval('f1.get_text_contents() == u"Foo\x1aBar"'), \ - f1.get_text_contents() + f1.get_text_contents() == "Foo\x1aBar", f1.get_text_contents() # Check for string which doesn't have BOM and isn't valid # ASCII @@ -1444,7 +1443,7 @@ class FSTestCase(_tempdirTestCase): c = e.get_text_contents() try: - eval('assert c == u"", c') + eval('assert c == "", c') except SyntaxError: assert c == "" @@ -1455,10 +1454,7 @@ class FSTestCase(_tempdirTestCase): assert e.__class__ == SCons.Node.FS.Entry, e.__class__ assert c == "", c c = e.get_text_contents() - try: - eval('assert c == u"", c') - except SyntaxError: - assert c == "", c + assert c == "", c test.write("tstamp", "tstamp\n") try: @@ -3311,15 +3307,7 @@ class RepositoryTestCase(_tempdirTestCase): # Use a test string that has a file terminator in it to make # sure we read the entire file, regardless of its contents. - try: - eval('test_string = u"Con\x1aTents\n"') - except SyntaxError: - import collections - class FakeUnicodeString(collections.UserString): - def encode(self, encoding): - return str(self) - - test_string = FakeUnicodeString("Con\x1aTents\n") + test_string = "Con\x1aTents\n" # Test with ASCII. test.write(["rep3", "contents"], test_string.encode('ascii')) diff --git a/src/engine/SCons/Scanner/ScannerTests.py b/src/engine/SCons/Scanner/ScannerTests.py index abe4042..6206af9 100644 --- a/src/engine/SCons/Scanner/ScannerTests.py +++ b/src/engine/SCons/Scanner/ScannerTests.py @@ -599,7 +599,7 @@ class ClassicCPPTestCase(unittest.TestCase): assert n == 'path/bbb', n assert i == 'bbb', i - n, i = s.find_include(('<', u'ccc'), 'foo', ('path',)) + n, i = s.find_include(('<', 'ccc'), 'foo', ('path',)) assert n == 'path/ccc', n assert i == 'ccc', i diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index d04b585..6ca0e03 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -169,7 +169,7 @@ class Task(object): """ global print_prepare T = self.tm.trace - if T: T.write(self.trace_message(u'Task.prepare()', self.node)) + if T: T.write(self.trace_message('Task.prepare()', self.node)) # Now that it's the appropriate time, give the TaskMaster a # chance to raise any exceptions it encountered while preparing @@ -231,7 +231,7 @@ class Task(object): prepare(), executed() or failed(). """ T = self.tm.trace - if T: T.write(self.trace_message(u'Task.execute()', self.node)) + if T: T.write(self.trace_message('Task.execute()', self.node)) try: cached_targets = [] @@ -397,7 +397,7 @@ class Task(object): """ global print_prepare T = self.tm.trace - if T: T.write(self.trace_message(u'Task.make_ready_current()', + if T: T.write(self.trace_message('Task.make_ready_current()', self.node)) self.out_of_date = [] @@ -445,7 +445,7 @@ class Task(object): that can be put back on the candidates list. """ T = self.tm.trace - if T: T.write(self.trace_message(u'Task.postprocess()', self.node)) + if T: T.write(self.trace_message('Task.postprocess()', self.node)) # We may have built multiple targets, some of which may have # common parents waiting for this build. Count up how many @@ -462,7 +462,7 @@ class Task(object): # A node can only be in the pending_children set if it has # some waiting_parents. if t.waiting_parents: - if T: T.write(self.trace_message(u'Task.postprocess()', + if T: T.write(self.trace_message('Task.postprocess()', t, 'removing')) pending_children.discard(t) @@ -491,7 +491,7 @@ class Task(object): for p, subtract in parents.items(): p.ref_count = p.ref_count - subtract - if T: T.write(self.trace_message(u'Task.postprocess()', + if T: T.write(self.trace_message('Task.postprocess()', p, 'adjusted parent ref count')) if p.ref_count == 0: @@ -792,7 +792,7 @@ class Taskmaster(object): while True: node = self.next_candidate() if node is None: - if T: T.write(self.trace_message('No candidate anymore.') + u'\n') + if T: T.write(self.trace_message('No candidate anymore.') + '\n') return None node = node.disambiguate() @@ -815,7 +815,7 @@ class Taskmaster(object): else: S = None - if T: T.write(self.trace_message(u' Considering node %s and its children:' % self.trace_node(node))) + if T: T.write(self.trace_message(' Considering node %s and its children:' % self.trace_node(node))) if state == NODE_NO_STATE: # Mark this node as being on the execution stack: @@ -823,7 +823,7 @@ class Taskmaster(object): elif state > NODE_PENDING: # Skip this node if it has already been evaluated: if S: S.already_handled = S.already_handled + 1 - if T: T.write(self.trace_message(u' already handled (executed)')) + if T: T.write(self.trace_message(' already handled (executed)')) continue executor = node.get_executor() @@ -854,7 +854,7 @@ class Taskmaster(object): for child in chain(executor.get_all_prerequisites(), children): childstate = child.get_state() - if T: T.write(self.trace_message(u' ' + self.trace_node(child))) + if T: T.write(self.trace_message(' ' + self.trace_node(child))) if childstate == NODE_NO_STATE: children_not_visited.append(child) @@ -915,7 +915,7 @@ class Taskmaster(object): # count so we can be put back on the list for # re-evaluation when they've all finished. node.ref_count = node.ref_count + child.add_to_waiting_parents(node) - if T: T.write(self.trace_message(u' adjusted ref count: %s, child %s' % + if T: T.write(self.trace_message(' adjusted ref count: %s, child %s' % (self.trace_node(node), repr(str(child))))) if T: @@ -941,7 +941,7 @@ class Taskmaster(object): # The default when we've gotten through all of the checks above: # this node is ready to be built. if S: S.build = S.build + 1 - if T: T.write(self.trace_message(u'Evaluating %s\n' % + if T: T.write(self.trace_message('Evaluating %s\n' % self.trace_node(node))) # For debugging only: diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index 4968a77..d96b63f 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -740,7 +740,7 @@ class UtilTestCase(unittest.TestCase): def test_LogicalLines(self): """Test the LogicalLines class""" - content = u""" + content = """ foo \\ bar \\ baz |