diff --git a/matlab_proxy/util/event_loop.py b/matlab_proxy/util/event_loop.py index 97b259f..1791752 100644 --- a/matlab_proxy/util/event_loop.py +++ b/matlab_proxy/util/event_loop.py @@ -25,7 +25,15 @@ def get_event_loop(): # If execution reached this except block, it implies that there # was no running event loop. So, create one. if system.is_posix(): - loop = asyncio.get_event_loop() + try: + # Creates loop before python <=3.13, + # fails with RuntimeError for greater versions + loop = asyncio.get_event_loop() + except RuntimeError: + # For python versions >=3.14: + # create the loop and set it as the current event loop + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) else: loop = windows.get_event_loop() diff --git a/pyproject.toml b/pyproject.toml index df806ee..576d775 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ description = "Python® package enables you to launch MATLAB® and access it fro readme = "README.md" license = "LicenseRef-MATHWORKS-CLOUD-REFERENCE-ARCHITECTURE-LICENSE" license-files = ["LICENSE.md"] -requires-python = ">=3.10, <3.14" +requires-python = ">=3.10, <3.15" authors = [ { name = "The MathWorks Inc.", email = "cloud@mathworks.com" }, ]