Use modern threading API instead of deprecated pre-/2.6 camelCase names
Showing 3 of 3 files from the diff.
cherrypy/process/wspbus.py
changed.
cherrypy/process/plugins.py
changed.
cherrypy/process/servers.py
changed.
@@ -356,13 +356,13 @@
Loading
356 | 356 | # implemented as a windows service and in any other case |
|
357 | 357 | # that another thread executes cherrypy.engine.exit() |
|
358 | 358 | if ( |
|
359 | - | t != threading.currentThread() and |
|
359 | + | t != threading.current_thread() and |
|
360 | 360 | not isinstance(t, threading._MainThread) and |
|
361 | 361 | # Note that any dummy (external) threads are |
|
362 | 362 | # always daemonic. |
|
363 | 363 | not t.daemon |
|
364 | 364 | ): |
|
365 | - | self.log('Waiting for thread %s.' % t.getName()) |
|
365 | + | self.log('Waiting for thread %s.' % t.name) |
|
366 | 366 | t.join() |
|
367 | 367 | ||
368 | 368 | if self.execv: |
@@ -570,7 +570,7 @@
Loading
570 | 570 | self.wait(states.STARTED) |
|
571 | 571 | func(*a, **kw) |
|
572 | 572 | t = threading.Thread(target=_callback, args=args, kwargs=kwargs) |
|
573 | - | t.setName('Bus Callback ' + t.getName()) |
|
573 | + | t.name = 'Bus Callback ' + t.name |
|
574 | 574 | t.start() |
|
575 | 575 | ||
576 | 576 | self.start() |
@@ -366,7 +366,7 @@
Loading
366 | 366 | # "The general problem with making fork() work in a multi-threaded |
|
367 | 367 | # world is what to do with all of the threads..." |
|
368 | 368 | # So we check for active threads: |
|
369 | - | if threading.activeCount() != 1: |
|
369 | + | if threading.active_count() != 1: |
|
370 | 370 | self.bus.log('There are %r active threads. ' |
|
371 | 371 | 'Daemonizing now may cause strange failures.' % |
|
372 | 372 | threading.enumerate(), level=30) |
@@ -552,7 +552,7 @@
Loading
552 | 552 | if self.thread is None: |
|
553 | 553 | self.thread = BackgroundTask(self.frequency, self.callback, |
|
554 | 554 | bus=self.bus) |
|
555 | - | self.thread.setName(threadname) |
|
555 | + | self.thread.name = threadname |
|
556 | 556 | self.thread.start() |
|
557 | 557 | self.bus.log('Started monitor thread %r.' % threadname) |
|
558 | 558 | else: |
@@ -565,8 +565,8 @@
Loading
565 | 565 | self.bus.log('No thread running for %s.' % |
|
566 | 566 | self.name or self.__class__.__name__) |
|
567 | 567 | else: |
|
568 | - | if self.thread is not threading.currentThread(): |
|
569 | - | name = self.thread.getName() |
|
568 | + | if self.thread is not threading.current_thread(): |
|
569 | + | name = self.thread.name |
|
570 | 570 | self.thread.cancel() |
|
571 | 571 | if not self.thread.daemon: |
|
572 | 572 | self.bus.log('Joining %r' % name) |
@@ -692,7 +692,7 @@
Loading
692 | 692 | filename) |
|
693 | 693 | self.thread.cancel() |
|
694 | 694 | self.bus.log('Stopped thread %r.' % |
|
695 | - | self.thread.getName()) |
|
695 | + | self.thread.name) |
|
696 | 696 | self.bus.restart() |
|
697 | 697 | return |
|
698 | 698 |
Files | Coverage |
---|---|
cherrypy | 80.01% |
Project Totals (105 files) | 80.01% |
1200.0
1200.0
1201.0
wbb4ppu28urj3gq7
1201.0
1 |
codecov: |
2 |
bot: codecov |
3 |
notify: |
4 |
require_ci_to_pass: yes |
5 |
|
6 |
coverage: |
7 |
precision: 2 |
8 |
round: down |
9 |
range: "70...100" |
10 |
|
11 |
status: |
12 |
# Only consider coverage of the code snippet changed in PR
|
13 |
project: no |
14 |
patch: yes |
15 |
changes: no |
16 |
|
17 |
parsers: |
18 |
gcov: |
19 |
branch_detection: |
20 |
conditional: yes |
21 |
loop: yes |
22 |
method: no |
23 |
macro: no |
24 |
|
25 |
comment: |
26 |
layout: "header, diff" |
27 |
behavior: default |
28 |
require_changes: no |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.