Copilot commented on code in PR #13328:
URL: https://github.com/apache/trafficserver/pull/13328#discussion_r3576089859


##########
tests/gold_tests/logging/ts_process_handler.py:
##########
@@ -36,10 +36,13 @@ def __init__(self, message):
 def get_ts_process_pid(ts_identifier):
     processes = []
     for proc in psutil.process_iter(['cmdline']):
+        # psutil returns a None cmdline for processes whose command line is not
+        # readable (e.g. system processes on macOS); skip those rather than
+        # letting ' '.join(None) raise TypeError before the target is found.
         cmdline = proc.info.get('cmdline', [])
         if not cmdline:

Review Comment:
   The new comment says this avoids `TypeError` from `' '.join(None)`, but the 
existing `if not cmdline: continue` already skips the `None` case before the 
join. As written, `cmdline or []` is redundant and the comment is misleading; 
consider simplifying by reading `cmdline` without a default and letting the `if 
not cmdline` guard handle `None`/empty.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to