From 595c47244b0bfce3023c14908c0cc6b6bb4e0aec Mon Sep 17 00:00:00 2001 From: anentropic Date: Mon, 3 Feb 2014 14:19:42 +0000 Subject: Make safe repr more safe --- factory/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factory/utils.py b/factory/utils.py index 276977a..7b48a1e 100644 --- a/factory/utils.py +++ b/factory/utils.py @@ -101,7 +101,7 @@ def import_object(module_name, attribute_name): def _safe_repr(obj): try: obj_repr = repr(obj) - except UnicodeError: + except: return '' % id(obj) try: # Convert to "text type" (= unicode) -- cgit v1.2.3 From e320cabc58bdb637f24d4b20df8c318a7420a55e Mon Sep 17 00:00:00 2001 From: anentropic Date: Thu, 13 Mar 2014 18:59:32 +0000 Subject: Update utils.py --- factory/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factory/utils.py b/factory/utils.py index 7b48a1e..6f0c763 100644 --- a/factory/utils.py +++ b/factory/utils.py @@ -101,7 +101,7 @@ def import_object(module_name, attribute_name): def _safe_repr(obj): try: obj_repr = repr(obj) - except: + except Exception: return '' % id(obj) try: # Convert to "text type" (= unicode) -- cgit v1.2.3