|
Revision 19009, 0.5 kB
(checked in by exarkun, 3 years ago)
|
Merge qtreactor-stub-2137
Author: PenguinOfDoom?
Reviewer: glyph
Fixes #2137
This adds a reactor plugin which will attempt to import qtreactor and
warn that the name qt is now deprecated. If qtreactor cannot be
imported it will point to the location from which it can be retrieved.
This also adds a similar backwards-compatibility stub for
twisted.internet.qtreactor for applications which install it themselves
rather than using twistd.
|
| Line | |
|---|
| 1 |
try: |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
install = __import__('qtreactor').install |
|---|
| 6 |
except ImportError: |
|---|
| 7 |
from twisted.plugins.qtreactor_stub import errorMessage |
|---|
| 8 |
raise ImportError(errorMessage) |
|---|
| 9 |
else: |
|---|
| 10 |
import warnings |
|---|
| 11 |
warnings.warn("Please use qtreactor instead of twisted.internet.qtreactor", |
|---|
| 12 |
category=DeprecationWarning) |
|---|
| 13 |
|
|---|
| 14 |
__all__ = ['install'] |
|---|
| 15 |
|
|---|