Skip to content

Commit

Permalink
Remove try/except around serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Nov 15, 2024
1 parent 0d3f297 commit 5453327
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions param/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
import warnings
from inspect import getfullargspec

# Allow this file to be used standalone if desired, albeit without JSON serialization
try:
from . import serializer
except ImportError:
serializer = None

from collections import defaultdict, namedtuple, OrderedDict
from functools import partial, wraps, reduce
from html import escape
Expand All @@ -39,6 +33,7 @@
from contextlib import contextmanager
from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL

from . import serializer
from ._utils import (
DEFAULT_SIGNATURE,
ParamDeprecationWarning as _ParamDeprecationWarning,
Expand Down Expand Up @@ -1307,8 +1302,6 @@ def deserialize(cls, value):
return value

def schema(self, safe=False, subset=None, mode='json'):
if serializer is None:
raise ImportError('Cannot import serializer.py needed to generate schema')
if mode not in self._serializers:
raise KeyError(f'Mode {mode!r} not in available serialization formats {list(self._serializers.keys())!r}')
return self._serializers[mode].param_schema(self.__class__.__name__, self,
Expand Down

0 comments on commit 5453327

Please sign in to comment.