PDF Output: Fix custom size field not accepting fractional numbers as sizes

This commit is contained in:
Kovid Goyal 2012-12-05 12:23:44 +05:30
parent 40136065f4
commit 7b22c622ed

View File

@ -27,10 +27,10 @@ def get_custom_size(opts):
custom_size = None custom_size = None
if opts.custom_size != None: if opts.custom_size != None:
width, sep, height = opts.custom_size.partition('x') width, sep, height = opts.custom_size.partition('x')
if height != '': if height:
try: try:
width = int(width) width = float(width)
height = int(height) height = float(height)
custom_size = (width, height) custom_size = (width, height)
except: except:
custom_size = None custom_size = None