Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove deprecated xblock.fragment import #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

UsamaSadiq
Copy link
Member

Description

This replace xblock.fragment with web_fragments.fragment. xblock.fragment was removed as of 2024-02-26. If this xblock is used in a course, the entire course will fail to load.

from xblock.fragment import Fragment
try:
from web_fragments.fragment import Fragment
except:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://peps.python.org/pep-0008/#programming-recommendations

A bare except: clause will catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. If you want to catch all exceptions that signal program errors, use except Exception: (bare except is equivalent to except BaseException:).

Comment on lines +43 to +44
# for backwards compatibility with quince and prior releases
from xblock.fragment import Fragment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? The Drag and Drop v2 XBlock has been working without such a fallback for over four years: openedx/xblock-drag-and-drop-v2@5334f4d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants