##// END OF EJS Templates
tweak exceptions in %precision
MinRK -
Show More
@@ -3504,15 +3504,15 Defaulting color scheme to 'NoColor'"""
3504 3504 fmt = s
3505 3505 try:
3506 3506 fmt%3.14159
3507 except:
3508 raise TypeError("Precision must be int or format string, not %r"%s)
3507 except Exception:
3508 raise ValueError("Precision must be int or format string, not %r"%s)
3509 3509 elif s:
3510 3510 # otherwise, should be an int
3511 3511 try:
3512 3512 i = int(s)
3513 3513 assert i >= 0
3514 except:
3515 raise TypeError("Precision must be non-negative int or format string, not %r"%s)
3514 except (ValueError, AssertionError):
3515 raise ValueError("Precision must be non-negative int or format string, not %r"%s)
3516 3516
3517 3517 fmt = '%%.%if'%i
3518 3518 if 'numpy' in sys.modules:
General Comments 0
You need to be logged in to leave comments. Login now