Browse Source

environment var rename: MMGEN_TRACEBACK -> MMGEN_EXEC_WRAPPER

The MMGen Project 3 years ago
parent
commit
d30fbba837
6 changed files with 8 additions and 7 deletions
  1. 1 1
      mmgen/base_proto/bitcoin/tx/unsigned.py
  2. 1 1
      mmgen/devtools.py
  3. 2 2
      mmgen/globalvars.py
  4. 1 1
      mmgen/main.py
  5. 1 1
      scripts/exec_wrapper.py
  6. 2 1
      test/test.py

+ 1 - 1
mmgen/base_proto/bitcoin/tx/unsigned.py

@@ -78,7 +78,7 @@ class Unsigned(Completed,TxBase.Unsigned):
 			return new
 		except Exception as e:
 			ymsg(f'\n{e.args[0]}')
-			if g.traceback:
+			if g.exec_wrapper:
 				import traceback
 				ymsg( '\n' + ''.join(traceback.format_exception(*sys.exc_info())) )
 			return False

+ 1 - 1
mmgen/devtools.py

@@ -5,7 +5,7 @@ class MMGenObject(object):
 	def immutable_attr_init_check(self): pass
 
 import os
-if os.getenv('MMGEN_DEBUG') or os.getenv('MMGEN_TEST_SUITE') or os.getenv('MMGEN_TRACEBACK'):
+if os.getenv('MMGEN_DEBUG') or os.getenv('MMGEN_TEST_SUITE') or os.getenv('MMGEN_EXEC_WRAPPER'):
 
 	import sys,re,traceback,json,pprint
 	from decimal import Decimal

+ 2 - 2
mmgen/globalvars.py

@@ -113,7 +113,7 @@ class GlobalContext(Lockable):
 	# test suite:
 	bogus_send           = False
 	debug_utf8           = False
-	traceback            = False
+	exec_wrapper         = False
 	test_suite           = False
 	test_suite_deterministic = False
 	test_suite_popen_spawn = False
@@ -253,7 +253,7 @@ class GlobalContext(Lockable):
 		'MMGEN_RPC_FAIL_ON_COMMAND',
 		'MMGEN_TESTNET',
 		'MMGEN_REGTEST',
-		'MMGEN_TRACEBACK',
+		'MMGEN_EXEC_WRAPPER',
 		'MMGEN_RPC_BACKEND',
 		'MMGEN_IGNORE_DAEMON_VERSION',
 		'MMGEN_USE_STANDALONE_SCRYPT_MODULE',

+ 1 - 1
mmgen/main.py

@@ -43,7 +43,7 @@ def launch(mod):
 	except EOFError:
 		sys.stderr.write('\nEnd of file\n')
 	except Exception as e:
-		if os.getenv('MMGEN_TRACEBACK'):
+		if os.getenv('MMGEN_EXEC_WRAPPER'):
 			raise
 		else:
 			try: m = '{}'.format(e.args[0])

+ 1 - 1
scripts/exec_wrapper.py

@@ -21,7 +21,7 @@ def exec_wrapper_init(): # don't change: name is used to test if script is runni
 		from test.overlay import overlay_setup
 		sys.path[0] = overlay_setup(repo_root=os.getcwd()) # assume we're in the repo root
 
-	os.environ['MMGEN_TRACEBACK'] = '1'
+	os.environ['MMGEN_EXEC_WRAPPER'] = '1'
 	os.environ['PYTHONPATH'] = '.'
 	if 'TMUX' in os.environ:
 		del os.environ['TMUX']

+ 2 - 1
test/test.py

@@ -724,7 +724,8 @@ class TestSuiteRunner(object):
 		os.environ['MMGEN_FORCE_COLOR'] = '1' if self.ts.color else ''
 
 		env = { 'EXEC_WRAPPER_SPAWN':'1' }
-		if 'exec_wrapper_init' in globals(): # Python 3.9: OR the dicts
+		if 'exec_wrapper_init' in globals(): # test.py itself is running under exec_wrapper
+			# Python 3.9: OR the dicts
 			env.update({ 'EXEC_WRAPPER_NO_TRACEBACK':'1' })
 		env.update(os.environ)