| 1 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
|
|---|
| 2 |
|
|---|
| 3 | The module ``_dummy_threading`` is added to ``sys.modules`` in order
|
|---|
| 4 | to not have ``threading`` considered imported. Had ``threading`` been
|
|---|
| 5 | directly imported it would have made all subsequent imports succeed
|
|---|
| 6 | regardless of whether ``thread`` was available which is not desired.
|
|---|
| 7 |
|
|---|
| 8 | :Author: Brett Cannon
|
|---|
| 9 | :Contact: [email protected]
|
|---|
| 10 |
|
|---|
| 11 | XXX: Try to get rid of ``_dummy_threading``.
|
|---|
| 12 |
|
|---|
| 13 | """
|
|---|
| 14 | from sys import modules as sys_modules
|
|---|
| 15 |
|
|---|
| 16 | import dummy_thread
|
|---|
| 17 |
|
|---|
| 18 | # Declaring now so as to not have to nest ``try``s to get proper clean-up.
|
|---|
|
|---|