Skip to content

Commit

Permalink
fix: backport IntFlag.__str__ for Python<3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Nov 26, 2024
1 parent 43c1f7a commit 07f6d96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/pyromark/_options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import sys
from enum import IntFlag


Expand Down Expand Up @@ -49,3 +50,7 @@ class Options(IntFlag):
"""<https://docs.rs/pulldown-cmark/0.12.2/pulldown_cmark/struct.Options.html#associatedconstant.ENABLE_GFM>"""
ENABLE_DEFINITION_LIST = 1 << 12
"""<https://docs.rs/pulldown-cmark/0.12.2/pulldown_cmark/struct.Options.html#associatedconstant.ENABLE_DEFINITION_LIST>"""

if sys.version_info < (3, 11):
__str__ = int.__repr__
__format__ = int.__format__

0 comments on commit 07f6d96

Please sign in to comment.