From 545332758148e8a0439c2cec718a40fc8e536536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 15 Nov 2024 16:04:28 +0100 Subject: [PATCH] Remove try/except around serializer --- param/parameterized.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/param/parameterized.py b/param/parameterized.py index c92a48be..f5ce4f5c 100644 --- a/param/parameterized.py +++ b/param/parameterized.py @@ -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 @@ -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, @@ -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,