Skip to content

Commit 345a514

Browse files
committed
Unregister event handler after docs are rendered
This fixes the case where we're generating multiple docs in a single invocation (such as html generation). By unregistering the event handler, a new instance can come along and register itself as the object to use for new doc events.
1 parent 12857ea commit 345a514

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

awscli/help.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,13 @@ def name(self):
223223

224224
def __call__(self, args, parsed_globals):
225225
# Create an event handler for a Provider Document
226-
self.EventHandlerClass(self)
226+
instance = self.EventHandlerClass(self)
227227
# Now generate all of the events for a Provider document.
228228
# We pass ourselves along so that we can, in turn, get passed
229229
# to all event handlers.
230230
bcdoc.clidocevents.generate_events(self.session, self)
231231
self.renderer.render(self.doc.getvalue())
232+
instance.unregister()
232233

233234

234235
class ProviderHelpCommand(HelpCommand):

0 commit comments

Comments
 (0)