Skip to content

Commit d1bc126

Browse files
danxshapwesm
authored andcommitted
make docstring handling more robust and work with -OO python interpreter option
1 parent c20ae64 commit d1bc126

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pandas/core/format.py

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class DataFrameFormatter(object):
156156
157157
"""
158158

159+
__doc__ = __doc__ if __doc__ else ''
159160
__doc__ += docstring_to_string
160161

161162
def __init__(self, frame, buf=None, columns=None, col_space=None,

pandas/util/decorators.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def __init__(self, addendum, join='', indents=0):
9393
self.join = join
9494

9595
def __call__(self, func):
96-
docitems = [func.__doc__ if func.__doc__ else '', self.addendum]
96+
func.__doc__ = func.__doc__ if func.__doc__ else ''
97+
self.addendum = self.addendum if self.addendum else ''
98+
docitems = [func.__doc__, self.addendum]
9799
func.__doc__ = ''.join(docitems)
98100
return func
99101

0 commit comments

Comments
 (0)