X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=python%2Fovs%2Fjson.py;fp=python%2Fovs%2Fjson.py;h=f8b02d18004cbb640e303f8997269abf7704f9c6;hb=ff2abab9c550b90f08b3ddb7487edded0c7903e6;hp=1e26a62909240903acd476a61764f01782c49034;hpb=f3399cd5be32fb67364959d75b973a4c23f2b19a;p=sliver-openvswitch.git diff --git a/python/ovs/json.py b/python/ovs/json.py index 1e26a6290..f8b02d180 100644 --- a/python/ovs/json.py +++ b/python/ovs/json.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010 Nicira Networks +# Copyright (c) 2010, 2011 Nicira Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,9 +114,7 @@ def from_string(s): s = unicode(s, 'utf-8') except UnicodeDecodeError, e: seq = ' '.join(["0x%2x" % ord(c) for c in e.object[e.start:e.end]]) - raise Error("\"%s\" is not a valid UTF-8 string: " - "invalid UTF-8 sequence %s" % (s, seq), - tag="constraint violation") + return ("not a valid UTF-8 string: invalid UTF-8 sequence %s" % seq) p = Parser(check_trailer=True) p.feed(s) return p.finish()