/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2014-01-06 16:01:46 UTC
  • Revision ID: teddy@recompile.se-20140106160146-v5gnpwf0vidfz7h7
Minor code fix; raise only exception instances, not classes.

* mandos (DBusObjectWithProperties.Set): Add error message if raising
                                         ValueError (should never
                                         happen anyway).

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# "AvahiService" class, and some lines in "main".
12
12
13
13
# Everything else is
14
 
# Copyright © 2008-2013 Teddy Hogeborn
15
 
# Copyright © 2008-2013 Björn Påhlsson
 
14
# Copyright © 2008-2014 Teddy Hogeborn
 
15
# Copyright © 2008-2014 Björn Påhlsson
16
16
17
17
# This program is free software: you can redistribute it and/or modify
18
18
# it under the terms of the GNU General Public License as published by
934
934
            # The byte_arrays option is not supported yet on
935
935
            # signatures other than "ay".
936
936
            if prop._dbus_signature != "ay":
937
 
                raise ValueError
 
937
                raise ValueError("Byte arrays not supported for non-"
 
938
                                 "'ay' signature {0!r}"
 
939
                                 .format(prop._dbus_signature))
938
940
            value = dbus.ByteArray(b''.join(chr(byte)
939
941
                                            for byte in value))
940
942
        prop(value)