summaryrefslogtreecommitdiff
path: root/lib/Crypto/SelfTest/st_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Crypto/SelfTest/st_common.py')
-rw-r--r--lib/Crypto/SelfTest/st_common.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Crypto/SelfTest/st_common.py b/lib/Crypto/SelfTest/st_common.py
index e0e206a..e76525c 100644
--- a/lib/Crypto/SelfTest/st_common.py
+++ b/lib/Crypto/SelfTest/st_common.py
@@ -72,4 +72,17 @@ def handle_fastmath_import_error():
"it failed. This may point to the gmp or mpir shared library "
"not being in the path. _fastmath was found at %s" % (pathname,))
+def docstrings_disabled():
+ """Returns True if docstrings are disabled (e.g. by using python -OO)"""
+ return docstrings_disabled.__doc__ is None
+
+def assert_disabled():
+ """Returns True if 'assert' is a no-op (e.g. by using python -O)"""
+ try:
+ assert False
+ except AssertionError:
+ return False
+ else:
+ return True
+
# vim:set ts=4 sw=4 sts=4 expandtab: