You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(Group 10 - Case Study 3) Refactor: remove duplicated KeyboardInterrupt/SystemExit handling in raw_main() #2013
raw_main() in httpie/core.py contains the same KeyboardInterrupt / SystemExit handling twice: once around parser.parse_args() and again around main_program().
Detected with PMD CPD (--minimum-tokens 25): 51 tokens, 11 lines, Type 1 (exact) clone. It is the largest duplicated block in httpie/ and the only one that survives at 50 tokens.
Proposed change
Extract the shared logic into one nested helper in raw_main(), next to the existing handle_generic_error(), and use it in both try blocks:
Activity