@@ -541,36 +541,37 @@ def _concat_rangeindex_same_dtype(indexes):
541541 """
542542 from pandas import Int64Index , RangeIndex
543543
544- start = step = next = None
544+ start = step = next_ = None
545545
546546 # Filter the empty indexes
547547 non_empty_indexes = [obj for obj in indexes if len (obj )]
548548
549549 for obj in non_empty_indexes :
550+ rng = obj ._range # type: range
550551
551552 if start is None :
552553 # This is set by the first non-empty index
553- start = obj . _start
554- if step is None and len (obj ) > 1 :
555- step = obj . _step
554+ start = rng . start
555+ if step is None and len (rng ) > 1 :
556+ step = rng . step
556557 elif step is None :
557558 # First non-empty index had only one element
558- if obj . _start == start :
559+ if rng . start == start :
559560 return _concat_index_same_dtype (indexes , klass = Int64Index )
560- step = obj . _start - start
561+ step = rng . start - start
561562
562- non_consecutive = ((step != obj . _step and len (obj ) > 1 ) or
563- (next is not None and obj . _start != next ))
563+ non_consecutive = ((step != rng . step and len (rng ) > 1 ) or
564+ (next_ is not None and rng . start != next_ ))
564565 if non_consecutive :
565566 return _concat_index_same_dtype (indexes , klass = Int64Index )
566567
567568 if step is not None :
568- next = obj [- 1 ] + step
569+ next_ = rng [- 1 ] + step
569570
570571 if non_empty_indexes :
571572 # Get the stop value from "next" or alternatively
572573 # from the last non-empty index
573- stop = non_empty_indexes [- 1 ]._stop if next is None else next
574+ stop = non_empty_indexes [- 1 ].stop if next_ is None else next_
574575 return RangeIndex (start , stop , step )
575576
576577 # Here all "indexes" had 0 length, i.e. were empty.
0 commit comments