Skip to content

Commit

Permalink
#2286 better backwards compatibility: ensure we always have a default…
Browse files Browse the repository at this point in the history
… value, not None

git-svn-id: https://xpra.org/svn/Xpra/trunk@22571 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 30, 2019
1 parent 490bba4 commit 1b2d2da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/xpra/client/client_window_base.py
Expand Up @@ -222,12 +222,12 @@ def set_metadata(self, metadata):
#perform metadata variable substitutions:
#full of py3k unicode headaches that don't need to be
default_values = {
"title" : "<untitled window>",
"client-machine" : "<unknown machine>",
"windowid" : str(self._id),
"server-machine" : getattr(self._client, "_remote_hostname", "<unknown machine>"),
"server-display" : getattr(self._client, "_remote_display", "<unknown display>"),
}
"title" : "<untitled window>",
"client-machine" : "<unknown machine>",
"windowid" : str(self._id),
"server-machine" : getattr(self._client, "_remote_hostname", None) or "<unknown machine>",
"server-display" : getattr(self._client, "_remote_display", None) or "<unknown display>",
}
def metadata_replace(match):
atvar = match.group(0) #ie: '@title@'
var = atvar[1:len(atvar)-1] #ie: 'title'
Expand Down

0 comments on commit 1b2d2da

Please sign in to comment.