Compatibility with Blender 2.93 / Python 3.9 → require Blender 2.80+

The code now requires Python 3.7 or newer, as a side-effect of the changes
required for compatibility with 3.9 (as used in Blender 2.93). As a result,
Blender Cloud Add-on now requires Blender 2.80 or newer.
This commit is contained in:
2021-02-16 11:04:24 +01:00
parent 2fbe7e1258
commit 883f125722
3 changed files with 14 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ bl_info = {
'blender': (2, 80, 0),
'location': 'Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser',
'description': 'Texture library browser and Blender Sync. Requires the Blender ID addon '
'and Blender 2.77a or newer.',
'and Blender 2.80 or newer.',
'wiki_url': 'https://wiki.blender.org/index.php/Extensions:2.6/Py/'
'Scripts/System/BlenderCloud',
'category': 'System',

View File

@@ -43,6 +43,8 @@ def setup_asyncio_executor():
# On Windows, the default event loop is SelectorEventLoop, which does
# not support subprocesses. ProactorEventLoop should be used instead.
# Source: https://docs.python.org/3/library/asyncio-subprocess.html
#
# NOTE: this is actually the default even loop in Python 3.9+.
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
else:
@@ -73,7 +75,11 @@ def kick_async_loop(*args) -> bool:
log.warning('loop closed, stopping immediately.')
return True
all_tasks = asyncio.Task.all_tasks()
# Passing an explicit loop is required. Without it, the function uses
# asyncio.get_running_loop(), which raises a RuntimeError as the current
# loop isn't running.
all_tasks = asyncio.all_tasks(loop=loop)
if not len(all_tasks):
log.debug('no more scheduled tasks, stopping after this kick.')
stop_after_this_kick = True