Skip to content

Commit f268d32

Browse files
committed
Convert kwargs to strings in order to support python 2.6
1 parent 7035c7e commit f268d32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

raven/contrib/django/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ def get_client(client=None):
141141

142142
class_name = str(class_name)
143143

144-
instance = getattr(__import__(module, {}, {}, class_name), class_name)(**options)
144+
try:
145+
instance = getattr(__import__(module, {}, {}, class_name), class_name)(**options)
146+
except TypeError:
147+
# Python 2.6 compatibility fix
148+
instance = getattr(__import__(module, {}, {}, class_name), class_name)(**dict([(str(key), val) for key, val in options.items()]))
145149
if not tmp_client:
146150
_client = (client, instance)
147151
return instance

0 commit comments

Comments
 (0)