From aaba1bf8227209d7640eba6de43438940a84d907 Mon Sep 17 00:00:00 2001 From: Seth M Morton Date: Sat, 4 Jun 2016 13:16:04 -0700 Subject: Fixed import bug when using python -OO. The -OO flag removes docstrings (sets them to None), which caused issues with the doctoring compatability wrapper because it was trying to call .format on None. The wrapper has been modified to check for None. This should solve issue #38. --- natsort/compat/py23.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/natsort/compat/py23.py b/natsort/compat/py23.py index 31a2944..8155798 100644 --- a/natsort/compat/py23.py +++ b/natsort/compat/py23.py @@ -90,7 +90,8 @@ def _modify_str_or_docstring(str_change_func): func = func_or_str doc = func.__doc__ - doc = str_change_func(doc) + if doc is not None: + doc = str_change_func(doc) if func: func.__doc__ = doc -- cgit v1.2.1