File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2345,12 +2345,13 @@ def _legal_dtype(series):
2345
2345
# no NaNs - can just concatenate
2346
2346
result = cat_core (all_cols , sep )
2347
2347
except TypeError as exc :
2348
- m = re .match (r'can only concatenate str \(not \"(\w+)\"\) to str' ,
2349
- str (exc ))
2350
- if m :
2351
- raise TypeError (err_wrong_dtype
2352
- + ' Received list-like containing element of'
2353
- + ' type: {}' .format (m .group (1 )))
2348
+ if re .match ((r'can only concatenate str \(not [\w\"]+) to str'
2349
+ r'|' # different numpy version have...
2350
+ r'Can\'t convert [\w\']+ object to str implicitly'
2351
+ r'|' # ... different error messages in np.sum
2352
+ r'must be str, not \w+' ),
2353
+ str (exc )):
2354
+ raise TypeError (err_wrong_dtype )
2354
2355
raise exc
2355
2356
2356
2357
if isinstance (self ._orig , Index ):
You can’t perform that action at this time.
0 commit comments