diff --git a/pandas/tools/merge.py b/pandas/tools/merge.py index c9935bf398cda..8fddfdda797c6 100644 --- a/pandas/tools/merge.py +++ b/pandas/tools/merge.py @@ -41,7 +41,7 @@ def merge(left, right, how='inner', on=None, left_on=None, right_on=None, merge.__doc__ = _merge_doc % '\nleft : DataFrame' -class MergeError(Exception): +class MergeError(ValueError): pass @@ -679,7 +679,7 @@ def concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, If a dict is passed, the sorted keys will be used as the `keys` argument, unless it is passed, in which case the values will be selected (see below). Any None objects will be dropped silently unless - they are all None in which case an Exception will be raised + they are all None in which case a ValueError will be raised axis : {0, 1, ...}, default 0 The axis to concatenate along join : {'inner', 'outer'}, default 'outer' @@ -764,7 +764,7 @@ def __init__(self, objs, axis=0, join='outer', join_axes=None, keys = clean_keys if len(objs) == 0: - raise Exception('All objects passed were None') + raise ValueError('All objects passed were None') # consolidate data & figure out what our result ndim is going to be ndims = set() diff --git a/pandas/tools/tests/test_merge.py b/pandas/tools/tests/test_merge.py index 89ff07bb7fa4c..c6335f623fa41 100644 --- a/pandas/tools/tests/test_merge.py +++ b/pandas/tools/tests/test_merge.py @@ -2122,7 +2122,7 @@ def test_concat_exclude_none(self): pieces = [df[:5], None, None, df[5:]] result = concat(pieces) tm.assert_frame_equal(result, df) - self.assertRaises(Exception, concat, [None, None]) + self.assertRaises(ValueError, concat, [None, None]) def test_concat_datetime64_block(self): from pandas.tseries.index import date_range