Issue #26182: Raise DeprecationWarning for improper use of async/await keywords

This commit is contained in:
Yury Selivanov 2016-09-15 12:50:23 -04:00
parent 6775231597
commit 8987c9d219
6 changed files with 125 additions and 56 deletions

View file

@ -353,14 +353,14 @@ class _AsyncDeprecatedProperty:
class DocumentLS:
"""Mixin to create documents that conform to the load/save spec."""
async = _AsyncDeprecatedProperty()
async_ = False
locals()['async'] = _AsyncDeprecatedProperty() # Avoid DeprecationWarning
def _get_async(self):
return False
def _set_async(self, async):
if async:
def _set_async(self, flag):
if flag:
raise xml.dom.NotSupportedErr(
"asynchronous document loading is not supported")