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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion image_explorer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"""
from .image_explorer import ImageExplorerBlock

__version__ = '2.2.1'
__version__ = '2.2.2'
6 changes: 5 additions & 1 deletion image_explorer/image_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
from parsel import Selector
from xblock.completable import XBlockCompletionMode
from xblock.core import XBlock
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:).

# for backwards compatibility with quince and prior releases
from xblock.fragment import Fragment
Comment on lines +43 to +44
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.

from xblock.fields import List, Scope, String, Boolean

from .utils import loader, AttrDict, _
Expand Down
Loading