From f603189dbe697b663f66a1d1e432f7c1aa1ed115 Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Mon, 2 Sep 2024 14:10:45 +0200
Subject: [PATCH] help: Support empty PAGER.

* awscli/help.py (PosixHelpRenderer._send_output_to_pager): Support empty PAGER.
---
 awscli/help.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/awscli/help.py b/awscli/help.py
index 1ce8571f3..c139a09bd 100644
--- a/awscli/help.py
+++ b/awscli/help.py
@@ -137,10 +137,10 @@

     def _send_output_to_pager(self, output):
         cmdline = self.get_pager_cmdline()
-        if not self._exists_on_path(cmdline[0]):
+        if not (cmdline and self._exists_on_path(cmdline[0])):
             LOG.debug(
-                "Pager '%s' not found in PATH, printing raw help." % cmdline[0]
-            )
+                "Pager '%s' not found in PATH, printing raw help.",
+                cmdline[0] if cmdline else "<empty>")
             self.output_stream.write(output.decode('utf-8') + "\n")
             self.output_stream.flush()
             return
-- 
2.46.0
