Skip to content
Merged
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
9 changes: 2 additions & 7 deletions minigu/python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,8 @@
HAS_RUST_BINDINGS = True
PyMiniGU = minigu_python.PyMiniGU
# Try to import the error checking functions
try:
is_transaction_error = minigu_python.is_transaction_error
is_not_implemented_error = minigu_python.is_not_implemented_error
except AttributeError:
# Fallback if these functions are not available
is_transaction_error = None
is_not_implemented_error = None
is_transaction_error = getattr(minigu_python, 'is_transaction_error', None)
is_not_implemented_error = getattr(minigu_python, 'is_not_implemented_error', None)
except ImportError as e:
# Fallback if the Rust extension is not available
HAS_RUST_BINDINGS = False
Expand Down
11 changes: 2 additions & 9 deletions minigu/python/minigu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@

# Import from package __init__.py - this is the primary way to get the Rust bindings
try:
from . import HAS_RUST_BINDINGS, PyMiniGU
# Try to import the error checking functions
try:
from . import is_transaction_error, is_not_implemented_error
except ImportError:
# Fallback if these functions are not available
is_transaction_error = None
is_not_implemented_error = None
except ImportError:
from . import HAS_RUST_BINDINGS, PyMiniGU, is_transaction_error, is_not_implemented_error
except (ImportError, ModuleNotFoundError):
# Fallback when running directly or if package imports fail
try:
import minigu_python
Expand Down