[Pkg-bitcoin-commits] [python-quamash] 161/269: fix some logging invocations

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository python-quamash.

commit 79e49f698b3196472ea04bcfef1333943f70f2d9
Author: Mark Harviston <mark.harviston at gmail.com>
Date:   Sun Dec 14 02:47:21 2014 -0800

    fix some logging invocations
    
    Error messages will be clearer because exceptions won't be nested.
    Uses {} formatting instead of % formatting
---
 quamash/__init__.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/quamash/__init__.py b/quamash/__init__.py
index bfca2c7..7bdac70 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -20,9 +20,13 @@ logger = logging.getLogger('quamash')
 
 try:
 	QtModuleName = os.environ['QUAMASH_QTIMPL']
-	logger.info('Forcing use of %s as Qt Implementation', QtModuleName)
-	QtModule = __import__(QtModuleName)
 except KeyError:
+	QtModule = None
+else:
+	logger.info('Forcing use of {} as Qt Implementation'.format(QtModuleName))
+	QtModule = __import__(QtModuleName)
+
+if not QtModule:
 	for QtModuleName in ('PyQt5', 'PyQt4', 'PySide'):
 		try:
 			QtModule = __import__(QtModuleName)
@@ -33,7 +37,7 @@ except KeyError:
 	else:
 		raise ImportError('No Qt implementations found')
 
-logger.info('Using Qt Implementation: %s', QtModuleName)
+logger.info('Using Qt Implementation: {}'.format(QtModuleName))
 
 QtCore = __import__(QtModuleName + '.QtCore', fromlist=(QtModuleName,))
 QtGui = __import__(QtModuleName + '.QtGui', fromlist=(QtModuleName,))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git



More information about the Pkg-bitcoin-commits mailing list