Skip to content

Commit

Permalink
fix 'type' object cannot be interpreted as an integer
Browse files Browse the repository at this point in the history
PDB stacktrace:
```
 plugins/twitter_bootstrap_rst_directives/bootstrap_rst_directives.py(369)run()                                                                                                                  
-> child.set_class('alert-link')
> tmp/lib/python3.7/site-packages/docutils/nodes.py(1072)set_class()
-> DeprecationWarning, stacklevel=2)
```

The deprecated function code:
```
  1067     def set_class(self, name):
  1068         """Add a new class to the "classes" attribute."""
  1069         warnings.warn('docutils.nodes.Element.set_class() is deprecated; '
  1070                       ' and will be removed in Docutils 0.21 or later.',
  1071                       "Append to Element['classes'] list attribute directly",
  1072                       DeprecationWarning, stacklevel=2)
  1073         assert ' ' not in name
  1074         self['classes'].append(name.lower())
```
  • Loading branch information
spaceone authored Jan 2, 2023
1 parent 324ab67 commit 4027227
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def run(self):
# Recurse inside its children and change the hyperlinks classes
for child in new_element.traverse(include_self=False):
if isinstance(child, nodes.reference):
child.set_class('alert-link')
child['classes'].appned('alert-link')
# Set its custom bootstrap classes
new_element['classes'] += ['alert ', alert_name]
# Return one single element
Expand Down

0 comments on commit 4027227

Please sign in to comment.