mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #26182: Raise DeprecationWarning for improper use of async/await keywords
This commit is contained in:
parent
6775231597
commit
8987c9d219
6 changed files with 125 additions and 56 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue