Merge lp:~dobey/ubuntuone-control-panel/fix-689800 into lp:ubuntuone-control-panel

Proposed by dobey
Status: Merged
Approved by: Natalia Bidart
Approved revision: 32
Merged at revision: 32
Proposed branch: lp:~dobey/ubuntuone-control-panel/fix-689800
Merge into: lp:ubuntuone-control-panel
Diff against target: 15 lines (+3/-1)
1 file modified
ubuntuone/controlpanel/dbus_service.py (+3/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-control-panel/fix-689800
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+43567@code.launchpad.net

Commit message

Default to None and initialize if None in code, instead of mutable defaults

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

This is a good practice in general.

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Awesome catch! Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/dbus_service.py'
2--- ubuntuone/controlpanel/dbus_service.py 2010-12-09 16:59:06 +0000
3+++ ubuntuone/controlpanel/dbus_service.py 2010-12-13 20:27:23 +0000
4@@ -328,8 +328,10 @@
5 return dbus.service.BusName(DBUS_BUS_NAME, bus=dbus.SessionBus())
6
7
8-def publish_backend(backend=ControlBackend()):
9+def publish_backend(backend=None):
10 """Publish the backend on the DBus."""
11+ if backend is None:
12+ backend = ControlBackend()
13 return ControlPanelBackend(backend=backend,
14 object_path=DBUS_PREFERENCES_PATH,
15 bus_name=get_busname())

Subscribers

People subscribed via source and target branches

to all changes: