From be851a51ffbf115299cb16b097c44158abf990c8 Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Sun, 24 Dec 2017 19:50:40 -0800 Subject: [PATCH] Remove all module-level aliases deprecated in 0.2.0 See gh-136, gh-68, gh-317, gh-353, gh-157. --- trio/__init__.py | 60 ---------------------------------------- trio/testing/__init__.py | 17 ------------ 2 files changed, 77 deletions(-) diff --git a/trio/__init__.py b/trio/__init__.py index 78de81400f..6077c04ef7 100644 --- a/trio/__init__.py +++ b/trio/__init__.py @@ -63,66 +63,6 @@ from . import ssl # Not imported by default: testing -# Stuff that got moved: -_deprecate.enable_attribute_deprecations(__name__) - -__deprecated_attributes__ = { - "Task": - _deprecate.DeprecatedAttribute(hazmat.Task, "0.2.0", issue=136), - "current_task": - _deprecate.DeprecatedAttribute( - hazmat.current_task, "0.2.0", issue=136 - ), - "Result": - _deprecate.DeprecatedAttribute(hazmat.Result, "0.2.0", issue=136), - "Value": - _deprecate.DeprecatedAttribute(hazmat.Value, "0.2.0", issue=136), - "Error": - _deprecate.DeprecatedAttribute(hazmat.Error, "0.2.0", issue=136), - "UnboundedQueue": - _deprecate.DeprecatedAttribute( - hazmat.UnboundedQueue, "0.2.0", issue=136 - ), - "run_in_worker_thread": - _deprecate.DeprecatedAttribute( - run_sync_in_worker_thread, "0.2.0", issue=68 - ), - "current_clock": - _deprecate.DeprecatedAttribute( - hazmat.current_clock, "0.2.0", issue=317 - ), - "current_statistics": - _deprecate.DeprecatedAttribute( - hazmat.current_statistics, "0.2.0", issue=317 - ), - # STATUS_IGNORED never made it into a release, but I think people were - # using while it was in the dev version, so we might as well provide an - # alias for a little while. - "STATUS_IGNORED": - _deprecate.DeprecatedAttribute( - TASK_STATUS_IGNORED, "0.2.0", issue=353 - ), -} - -_deprecate.enable_attribute_deprecations(hazmat.__name__) - -hazmat.__deprecated_attributes__ = { - "yield_briefly": - _deprecate.DeprecatedAttribute(hazmat.checkpoint, "0.2.0", issue=157), - "yield_briefly_no_cancel": - _deprecate.DeprecatedAttribute( - hazmat.cancel_shielded_checkpoint, "0.2.0", issue=157 - ), - "yield_if_cancelled": - _deprecate.DeprecatedAttribute( - hazmat.checkpoint_if_cancelled, "0.2.0", issue=157 - ), - "yield_indefinitely": - _deprecate.DeprecatedAttribute( - hazmat.wait_task_rescheduled, "0.2.0", issue=157 - ), -} - # Having the public path in .__module__ attributes is important for: # - exception names in printed tracebacks # - sphinx :show-inheritance: diff --git a/trio/testing/__init__.py b/trio/testing/__init__.py index ea9eeb34da..1523d4b205 100644 --- a/trio/testing/__init__.py +++ b/trio/testing/__init__.py @@ -27,23 +27,6 @@ ################################################################ -from .. import _deprecate - -_deprecate.enable_attribute_deprecations(__name__) - -__deprecated_attributes__ = { - "assert_yields": - _deprecate.DeprecatedAttribute(assert_checkpoints, "0.2.0", issue=157), - "assert_no_yields": - _deprecate.DeprecatedAttribute( - assert_no_checkpoints, "0.2.0", issue=157 - ), -} - -del _deprecate - -################################################################ - from .._util import fixup_module_metadata fixup_module_metadata(__name__, globals()) del fixup_module_metadata