Browse Source

py3port: minor fixes

MMGen 6 years ago
parent
commit
88039bb3c1
4 changed files with 6 additions and 6 deletions
  1. 1 1
      mmgen/altcoins/eth/tw.py
  2. 2 2
      mmgen/rpc.py
  3. 2 2
      mmgen/seed.py
  4. 1 1
      test/test.py

+ 1 - 1
mmgen/altcoins/eth/tw.py

@@ -46,7 +46,7 @@ class EthereumTrackingWallet(TrackingWallet):
 			except:
 				self.orig_data = ''
 				self.data = {'coin':g.coin,'accounts':{},'tokens':{}}
-			else: die(2,"File '{}' exists but does not contain valid json data")
+			else: die(2,"File '{}' exists but does not contain valid json data".format(self.tw_file))
 		else:
 			self.upgrade_wallet_maybe()
 			m = 'Tracking wallet coin ({}) does not match current coin ({})!'

+ 2 - 2
mmgen/rpc.py

@@ -145,7 +145,7 @@ class CoinDaemonRPCConnection(object):
 			if cf['on_fail'] not in ('silent','raise'):
 				msg_r(yellow('{} RPC Error: '.format(g.proto.daemon_name.capitalize())))
 				msg(red('{} {}'.format(r.status,r.reason)))
-			e1 = r.read()
+			e1 = r.read().decode()
 			try:
 				e3 = json.loads(e1)['error']
 				e2 = '{} (code {})'.format(e3['message'],e3['code'])
@@ -153,7 +153,7 @@ class CoinDaemonRPCConnection(object):
 				e2 = str(e1)
 			return do_fail(r,1,e2)
 
-		r2 = r.read()
+		r2 = r.read().decode()
 
 		dmsg_rpc('    RPC REPLY data ==> {}\n'.format(r2))
 

+ 2 - 2
mmgen/seed.py

@@ -450,8 +450,8 @@ class Mnemonic (SeedSourceUnenc):
 		mn = self.fmt_data.split()
 
 		if len(mn) not in self.mn_lens:
-			msg('Invalid mnemonic ({} words).  Valid numbers of words: {}'.format(
-					(len(mn),', '.join(map(str,self.mn_lens)))))
+			m = 'Invalid mnemonic ({} words).  Valid numbers of words: {}'
+			msg(m.format(len(mn),', '.join(map(str,self.mn_lens))))
 			return False
 
 		for n,w in enumerate(mn,1):

+ 1 - 1
test/test.py

@@ -2781,7 +2781,7 @@ class MMGenTestSuite(object):
 				t.expect(['Passphrase is OK',' are correct'])
 		# Output
 		wf = t.written_to_file('Mnemonic data',oo=oo)
-		t.close()
+		t.p.wait()
 		t.ok()
 		# back check of result
 		if opt.profile: msg('')