Customized xblock-lti-consumer not rendering properly

After upgrading our development environment to version Nutmeg, I found that our company’s customized version of the xblock-lti-consumer was not rendering properly in Studio. Sorry, this site still tells me that I am a new user and can not upload an image. The following are the error logs that appear in both the development environment as well as the local Tutor instance running on Nutmeg:

2023-03-08 14:48:33 Traceback (most recent call last):
2023-03-08 14:48:33   File "/openedx/edx-platform/./cms/djangoapps/contentstore/views/preview.py", line 333, in get_preview_fragment
2023-03-08 14:48:33     fragment = module.render(preview_view, context)
2023-03-08 14:48:33   File "/openedx/venv/lib/python3.8/site-packages/xblock/core.py", line 198, in render
2023-03-08 14:48:33     return self.runtime.render(self, view, context)
2023-03-08 14:48:33   File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 2186, in render
2023-03-08 14:48:33     return self.__getattr__('render')(block, view_name, context)
2023-03-08 14:48:33   File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1428, in render
2023-03-08 14:48:33     return super().render(block, view_name, context=context)
2023-03-08 14:48:33   File "/openedx/venv/lib/python3.8/site-packages/xblock/runtime.py", line 847, in render
2023-03-08 14:48:33     frag = view_fn(context)
2023-03-08 14:48:33   File "/openedx/requirements/ngp-pdla-xblock-lti-consumer/myu_lti_consumer/lti_xblock.py", line 934, in author_view
2023-03-08 14:48:33     return self.student_view(context)
2023-03-08 14:48:33   File "/openedx/requirements/ngp-pdla-xblock-lti-consumer/myu_lti_consumer/lti_xblock.py", line 968, in student_view
2023-03-08 14:48:33     context.update(self._get_context_for_template())
2023-03-08 14:48:33   File "/openedx/requirements/ngp-pdla-xblock-lti-consumer/myu_lti_consumer/lti_xblock.py", line 1422, in _get_context_for_template
2023-03-08 14:48:33     allowed_tags = bleach.sanitizer.ALLOWED_TAGS | {'img'}
2023-03-08 14:48:33 TypeError: unsupported operand type(s) for |: 'list' and 'set'

The bleach package has breaking changes in version 6.0.0 around lists vs sets, and edx-platform’s master branch uses that. However, nutmeg is still on version 5-something. My guess is that you’ve got a mismatched virtualenv.