Skip to content

Commit

Permalink
revert polling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft committed Jun 16, 2021
1 parent 9eb57c0 commit 5a27019
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sdk/core/azure-core/azure/core/polling/base_polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@

if TYPE_CHECKING:
from azure.core.pipeline import PipelineResponse
from azure.core.rest import HttpResponse, AsyncHttpResponse, HttpRequest
from azure.core.pipeline.transport import (
HttpResponse,
AsyncHttpResponse,
HttpRequest,
)

ResponseType = Union[HttpResponse, AsyncHttpResponse]
PipelineResponseType = PipelineResponse[HttpRequest, ResponseType]
Expand Down Expand Up @@ -88,7 +92,7 @@ def _as_json(response):
:raises: DecodeError if response body contains invalid json data.
"""
try:
return response.json()
return json.loads(response.text())
except ValueError:
raise DecodeError("Error occurred in deserializing the response body.")

Expand Down Expand Up @@ -117,10 +121,7 @@ def _is_empty(response):
:rtype: bool
"""
try:
return not bool(response.content)
except Exception:
a = "b"
return not bool(response.body())


class LongRunningOperation(ABC):
Expand Down

0 comments on commit 5a27019

Please sign in to comment.