summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-02-05 17:14:14 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-02-06 11:09:53 -0500
commitb72695085f93eeb66167849a4c141dfc1781d620 (patch)
tree2673098befc3b92880f2e03f0099d7fa9eeff6b1
parent642647abdadea247c32d8dad8e5755f52238574c (diff)
downloadpython-coveragepy-git-b72695085f93eeb66167849a4c141dfc1781d620.tar.gz
debug: another lab debugging tool
-rw-r--r--lab/show_ast.py11
-rw-r--r--lab/show_platform.py3
2 files changed, 14 insertions, 0 deletions
diff --git a/lab/show_ast.py b/lab/show_ast.py
new file mode 100644
index 00000000..5e5bd04a
--- /dev/null
+++ b/lab/show_ast.py
@@ -0,0 +1,11 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
+
+"""Dump the AST of a file."""
+
+import ast
+import sys
+
+from coverage.parser import ast_dump
+
+ast_dump(ast.parse(open(sys.argv[1], "rb").read()))
diff --git a/lab/show_platform.py b/lab/show_platform.py
index a5c3d954..92730c03 100644
--- a/lab/show_platform.py
+++ b/lab/show_platform.py
@@ -1,3 +1,6 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
+
import platform
import types