Skip to content

Commit

Permalink
Merge pull request ycm-core#144 from mispencer/SerializingObjectWitho…
Browse files Browse the repository at this point in the history
…utDict

Handle serializing objects without __dict__
Valloric committed May 30, 2015
2 parents c041986 + a908e27 commit 017d65d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ycmd/handlers.py
Original file line number Diff line number Diff line change
@@ -194,9 +194,12 @@ def _JsonResponse( data ):


def _UniversalSerialize( obj ):
serialized = obj.__dict__.copy()
serialized[ 'TYPE' ] = type( obj ).__name__
return serialized
try:
serialized = obj.__dict__.copy()
serialized[ 'TYPE' ] = type( obj ).__name__
return serialized
except AttributeError:
return str( obj )


def _GetCompleterForRequestData( request_data ):

0 comments on commit 017d65d

Please sign in to comment.