Skip to content

Commit 96f8363

Browse files
tomvdwThe TensorFlow Datasets Authors
authored and
The TensorFlow Datasets Authors
committed
Simplify dependencies by not using pyutils.reraise
PiperOrigin-RevId: 692877334
1 parent c03fd8d commit 96f8363

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Diff for: tensorflow_datasets/core/naming.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from typing import Any
2727

2828
from etils import epath
29-
from tensorflow_datasets.core.utils import py_utils
3029
from tensorflow_datasets.core.utils import version as version_lib
3130

3231
_NAME_CLASS = r'[a-zA-Z][\w]*'
@@ -185,8 +184,9 @@ def _dataset_name_and_kwargs_from_name_str(
185184
raise ValueError('Dataset %s: cannot pass %s twice.' % (name, attr))
186185
kwargs[attr] = val
187186
return name, kwargs
188-
except Exception as e: # pylint: disable=broad-except
189-
py_utils.reraise(e, prefix=err_msg) # pytype: disable=bad-return-type
187+
except Exception as e:
188+
e.add_note(err_msg)
189+
raise e
190190

191191

192192
@dataclasses.dataclass(order=True)

Diff for: tensorflow_datasets/core/utils/file_utils_test.py

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from tensorflow_datasets.core import constants
2525
from tensorflow_datasets.core import naming
2626
from tensorflow_datasets.core.utils import file_utils
27-
from tensorflow_datasets.core.utils import read_config
2827

2928
_DATA_DIR = epath.Path('/a')
3029
_DATASET_NAME = 'my_ds'

0 commit comments

Comments
 (0)