Skip to content

Commit e9bb3a8

Browse files
committed
Update min-requirement of azure-core to fix build.
1 parent 5a1d34a commit e9bb3a8

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

sdk/communication/azure-communication-callingserver/azure/communication/callingserver/_download.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import threading
1010
from typing import Iterator
1111
from io import BytesIO
12+
from six import reraise as raise_
1213
from azure.core.exceptions import HttpResponseError
1314
from azure.core.tracing.common import with_current_context
1415
from .utils._utils import CallingServerUtils
@@ -148,12 +149,15 @@ def __anext__(self):
148149
try:
149150
chunk = next(self._iter_chunks)
150151
self._current_content += self._iter_downloader.yield_chunk(chunk)
151-
except StopIteration as ex:
152+
except StopIteration:
152153
self._complete = True
153154
# it's likely that there some data left in self._current_content
154155
if self._current_content:
155156
return self._current_content
156-
raise StopIteration("Download complete") from ex
157+
# https://stackoverflow.com/questions/27318327/how-to-imitate-python-3s-raise-from-in-python-2
158+
# https://stackoverflow.com/questions/34463087/valid-syntax-in-both-python-2-x-and-3-x-for-raising-exception/40877934
159+
traceback = sys.exc_info()[2]
160+
raise_(StopIteration, "Download complete", traceback)
157161

158162
return self._get_chunk_data()
159163

@@ -316,8 +320,11 @@ def readinto(self, stream):
316320

317321
try:
318322
stream.seek(stream.tell())
319-
except (NotImplementedError, AttributeError) as ex:
320-
raise ValueError(error_message) from ex
323+
except (NotImplementedError, AttributeError):
324+
# https://stackoverflow.com/questions/27318327/how-to-imitate-python-3s-raise-from-in-python-2
325+
# https://stackoverflow.com/questions/34463087/valid-syntax-in-both-python-2-x-and-3-x-for-raising-exception/40877934
326+
traceback = sys.exc_info()[2]
327+
raise_(ValueError, error_message, traceback)
321328

322329
# Write the content to the user stream
323330
stream.write(self._current_content)

sdk/communication/azure-communication-callingserver/azure/communication/callingserver/aio/_content_downloader_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# disabled unsubscriptable-object because of pylint bug referenced here:
99
# https://github.com/PyCQA/pylint/issues/3882
1010

11-
from typing import IO, Optional, TYPE_CHECKING
11+
from typing import Any, IO, Optional, TYPE_CHECKING
1212
from urllib.parse import urlparse
1313

1414
from azure.core.pipeline import PipelineResponse
@@ -20,7 +20,7 @@
2020

2121
if TYPE_CHECKING:
2222
# pylint: disable=unused-import,ungrouped-imports
23-
from typing import Any, Callable, Dict, Generic, TypeVar
23+
from typing import Callable, Dict, Generic, TypeVar
2424

2525
T = TypeVar('T')
2626
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
-e ../../../tools/azure-sdk-tools
2-
../../core/azure-core
32
-e ../../identity/azure-identity
43
-e ../../../tools/azure-devtools
54
-e ../azure-communication-identity
65
-e ../../../tools/vcrpy
76
../../nspkg/azure-communication-nspkg
7+
../../core/azure-core
88
aiohttp>=3.0; python_version >= '3.5'
99
parameterized
1010
validators

sdk/communication/azure-communication-callingserver/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
'azure.communication'
6262
]),
6363
install_requires=[
64-
'azure-core<2.0.0,>=1.11.0',
64+
'azure-core<2.0.0,>=1.16.0',
6565
'msrest>=0.6.0',
6666
'six>=1.11.0',
6767
'validators>=0.10.4'

shared_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ opentelemetry-sdk<2.0.0,>=1.0.0
201201
#override azure-eventgrid azure-core<2.0.0,>=1.18.0
202202
#override azure-monitor-query msrest>=0.6.19
203203
#override azure-monitor-query azure-core<2.0.0,>=1.12.0
204-
#override azure-communication-callingserver azure-core<2.0.0,>=1.11.0
204+
#override azure-communication-callingserver azure-core<2.0.0,>=1.16.0
205205
#override azure-communication-callingserver msrest>=0.6.0
206206
#override azure-communication-chat msrest>=0.6.0
207207
#override azure-communication-sms msrest>=0.6.0

0 commit comments

Comments
 (0)