Skip to content

fix: handle PYTHONOPTIMIZE=2 stripping docstrings (closes #702)#824

Open
botbikamordehai2-sketch wants to merge 1 commit into
brainix:masterfrom
botbikamordehai2-sketch:fix/issue-702-1779955276
Open

fix: handle PYTHONOPTIMIZE=2 stripping docstrings (closes #702)#824
botbikamordehai2-sketch wants to merge 1 commit into
brainix:masterfrom
botbikamordehai2-sketch:fix/issue-702-1779955276

Conversation

@botbikamordehai2-sketch
Copy link
Copy Markdown

What

When PYTHONOPTIMIZE=2 is set, Python strips all docstrings, causing __doc__ to be None. The line __description__ = __doc__.split(sep='\n\n', maxsplit=1)[0] then raises AttributeError: 'NoneType' object has no attribute 'split', breaking the import of pottery.

Fix

Guard against __doc__ being None by using (__doc__ or '') before calling .split().

Closes #702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PYTHONOPTIMIZE 2 is breaking import of pottery

1 participant