]> gitweb.michael.orlitzky.com - dunshire.git/blobdiff - dunshire/games.py
Add a new DEBUG_FLOAT_FORMAT and use it when raising game exceptions.
[dunshire.git] / dunshire / games.py
index 3575da52b15c0b874a1ebb0fd346d46947d887d4..2d6d6dae8d75352e4876954ba0cc2eff454c67f7 100644 (file)
@@ -1028,9 +1028,14 @@ class SymmetricLinearGame:
             return self._try_solution(options.ABS_TOL / 10)
 
         except (PoorScalingException, GameUnsolvableException):
-            # Ok, that didn't work. Let's try it with the default
-            # tolerance, and whatever happens, happens.
-            return self._try_solution(options.ABS_TOL)
+            # Ok, that didn't work. Let's try it with the default tolerance..
+            try:
+                return self._try_solution(options.ABS_TOL / 10)
+            except (PoorScalingException, GameUnsolvableException) as error:
+                # Well, that didn't work either. Let's verbosify the matrix
+                # output format before we allow the exception to be raised.
+                printing.options['dformat'] = options.DEBUG_FLOAT_FORMAT
+                raise error
 
 
     def condition(self):