Patchwork [1,of,8] check-seclevel: add a --debug option

login
register
mail settings
Submitter Bryan O'Sullivan
Date Dec. 23, 2015, 6:24 a.m.
Message ID <61485e243f6516ee33c8.1450851879@bryano-mbp.local>
Download mbox | patch
Permalink /patch/12265/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Bryan O'Sullivan - Dec. 23, 2015, 6:24 a.m.
# HG changeset patch
# User Bryan O'Sullivan <bos@serpentine.com>
# Date 1450849085 28800
#      Tue Dec 22 21:38:05 2015 -0800
# Node ID 61485e243f6516ee33c8ccfb664cd896ce090f23
# Parent  fe376159a58d9b3d748b669ac011b0eed0346fea
check-seclevel: add a --debug option

This will make it possible to get semi-meaningful tracebacks if an import
error occurs.

Why care? Trying to run this script under pypy currently fails, but the
true error is obscured.

Patch

diff --git a/doc/check-seclevel.py b/doc/check-seclevel.py
--- a/doc/check-seclevel.py
+++ b/doc/check-seclevel.py
@@ -127,6 +127,9 @@  option.
     optparser.add_option("-v", "--verbose",
                          help="enable additional output",
                          action="store_true")
+    optparser.add_option("-d", "--debug",
+                         help="debug mode",
+                         action="store_true")
     optparser.add_option("-f", "--file",
                          help="filename to read in (or '-' for stdin)",
                          action="store", default="")
@@ -152,6 +155,7 @@  option.
 
     ui = uimod.ui()
     ui.setconfig('ui', 'verbose', options.verbose, '--verbose')
+    ui.setconfig('ui', 'debug', options.debug, '--debug')
 
     if options.file:
         if checkfile(ui, options.file, options.initlevel):