From 7a76e21e996cea5eed25ab10519c372a6074456a Mon Sep 17 00:00:00 2001 From: j Date: Sun, 22 Feb 2015 16:37:42 +0530 Subject: [PATCH] only strip strings --- oml/media/pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oml/media/pdf.py b/oml/media/pdf.py index a49522b..e1ad951 100644 --- a/oml/media/pdf.py +++ b/oml/media/pdf.py @@ -122,7 +122,7 @@ def info(pdf): if isinstance(value, dict) and 'x-default' in value: value = value['x-default'] elif isinstance(value, list): - value = [v.strip() for v in value if v.strip()] + value = [v.strip() if isinstance(v, str) else v for v in value if v.strip()] _key = key[3:] if value and _key not in data: data[_key] = value