Fix starting Blender with Python 3.10
URL presets weren't working, raising a Python exception when the splash screen was displayed.
This commit is contained in:
@@ -979,6 +979,12 @@ class WM_OT_url_open(Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: needed for Python 3.10 since there are name-space issues with annotations.
|
||||||
|
# This can be moved into the class as a static-method once Python 3.9x is dropped.
|
||||||
|
def _wm_url_open_preset_type_items(_self, _context):
|
||||||
|
return [item for (item, _) in WM_OT_url_open_preset.preset_items]
|
||||||
|
|
||||||
|
|
||||||
class WM_OT_url_open_preset(Operator):
|
class WM_OT_url_open_preset(Operator):
|
||||||
"""Open a preset website in the web browser"""
|
"""Open a preset website in the web browser"""
|
||||||
bl_idname = "wm.url_open_preset"
|
bl_idname = "wm.url_open_preset"
|
||||||
@@ -987,9 +993,7 @@ class WM_OT_url_open_preset(Operator):
|
|||||||
|
|
||||||
type: EnumProperty(
|
type: EnumProperty(
|
||||||
name="Site",
|
name="Site",
|
||||||
items=lambda self, _context: (
|
items=_wm_url_open_preset_type_items,
|
||||||
item for (item, _) in WM_OT_url_open_preset.preset_items
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
id: StringProperty(
|
id: StringProperty(
|
||||||
|
|||||||
Reference in New Issue
Block a user