Browse Source

minor fixes and cleanups

The MMGen Project 3 years ago
parent
commit
906f0320d1
4 changed files with 5 additions and 7 deletions
  1. 1 0
      extmod/secp256k1mod.c
  2. 0 6
      mmgen/cfg.py
  3. 1 1
      scripts/create-token.py
  4. 3 0
      test/test_py_d/ts_cfg.py

+ 1 - 0
extmod/secp256k1mod.c

@@ -16,6 +16,7 @@
   this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <secp256k1.h>
 

+ 0 - 6
mmgen/cfg.py

@@ -40,7 +40,6 @@ class CfgFile(object):
 	warn_missing = True
 	write_metadata = False
 	fn_base = g.proj_name.lower() + '.cfg'
-	file_not_found_fs = 'WARNING: {} not found at {!r}'
 	line_data = namedtuple('cfgfile_line',['name','value','lineno','chunk'])
 
 	class warn_missing_file(oneshot_warning):
@@ -99,7 +98,6 @@ class CfgFile(object):
 			'usr':    CfgFileUsr,
 			'sys':    CfgFileSampleSys,
 			'sample': CfgFileSampleUsr,
-			'dist':   CfgFileSampleDist,
 		}
 		return d[id_str]
 
@@ -179,10 +177,6 @@ class CfgFileUsr(CfgFile):
 		if not self.data:
 			self.copy_data()
 
-class CfgFileSampleDist(CfgFileSample):
-	desc = 'source distribution configuration file'
-	fn_dir = 'data_files'
-
 class CfgFileSampleSys(CfgFileSample):
 	desc = 'system sample configuration file'
 	test_fn_subdir = 'usr.local.share'

+ 1 - 1
scripts/create-token.py

@@ -26,7 +26,7 @@ class TokenData:
 	fields = ('decimals','supply','name','symbol','owner_addr')
 	decimals   = ti('18', int, lambda s: s.isascii() and s.isdigit() and 0 < int(s) <= 36)
 	name       = ti(None, str, lambda s: s.isascii() and s.isprintable() and len(s) < 256)
-	supply     = ti(None, int, lambda s: s.isascii() and s.isdigit() and 0 < int(s) <= 2**256 - 1)
+	supply     = ti(None, int, lambda s: s.isascii() and s.isdigit() and 0 < int(s) < 2**256)
 	symbol     = ti(None, str, lambda s: s.isascii() and s.isalnum() and len(s) <= 20)
 	owner_addr = ti(None, str, lambda s: s.isascii() and s.isalnum() and len(s) == 40) # checked separately
 

+ 3 - 0
test/test_py_d/ts_cfg.py

@@ -38,6 +38,9 @@ class TestSuiteCfg(TestSuiteBase):
 		os.environ['MMGEN_TEST_SUITE_CFGTEST'] = '1'
 		TestSuiteBase.__init__(self,trunner,cfgs,spawn)
 
+	def __del__(self):
+		os.environ['MMGEN_TEST_SUITE_CFGTEST'] = ''
+
 	def spawn_test(self,args=[],extra_desc=''):
 		return self.spawn(
 			'test/misc/cfg.py',