Skip to content

Commit

Permalink
Guard against missing docstrings under python -OO (Fixes #52)
Browse files Browse the repository at this point in the history
  • Loading branch information
njsmith committed Jan 13, 2015
1 parent e6cf049 commit 4a4543b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions patsy/mgcv_cubic_splines.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,10 @@ class CR(CubicRegressionSpline):
as implemented in the R package 'mgcv' (GAM modelling).
"""
__doc__ += CubicRegressionSpline.common_doc

# Under python -OO, __doc__ will be defined but set to None
if __doc__:
__doc__ += CubicRegressionSpline.common_doc

def __init__(self):
CubicRegressionSpline.__init__(self, name='cr', cyclic=False)
Expand All @@ -732,7 +735,10 @@ class CC(CubicRegressionSpline):
as implemented in the R package 'mgcv' (GAM modelling).
"""
__doc__ += CubicRegressionSpline.common_doc

# Under python -OO, __doc__ will be defined but set to None
if __doc__:
__doc__ += CubicRegressionSpline.common_doc

def __init__(self):
CubicRegressionSpline.__init__(self, name='cc', cyclic=True)
Expand Down

0 comments on commit 4a4543b

Please sign in to comment.