-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate them in a way that doesn't break reactor installation
installReactor and deprecatedModuleAttribute have a fight :/
- Loading branch information
Showing
5 changed files
with
41 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Support similar deprecation of several reactors. | ||
""" | ||
|
||
import warnings | ||
|
||
from twisted.python.deprecate import DEPRECATION_WARNING_FORMAT | ||
from incremental import Version, getVersionString | ||
|
||
def deprecatedGnomeReactor(name: str, version: Version) -> None: | ||
""" | ||
Emit a deprecation warning about a gnome-related reactor. | ||
@param name: The name of the reactor. For example, C{"gtk2reactor"}. | ||
@param version: The version in which the deprecation was introduced. | ||
""" | ||
stem = DEPRECATION_WARNING_FORMAT % { | ||
"fqpn": "twisted.internet." + name, | ||
"version": getVersionString(version), | ||
} | ||
msg = stem + ". Please use twisted.internet.gireactor instead." | ||
warnings.warn(msg, category=DeprecationWarning) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters