~mikemc/ubuntu-sso-client/fix-1037395-run-mac-tests

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/proxy_dialog.py

The second of three changes to prepare SSO for Python 3 Unicode usage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
from ubuntu_sso.logger import setup_gui_logging
39
39
from ubuntu_sso.keyring import Keyring
40
40
from ubuntu_sso.qt.ui.proxy_credentials_dialog_ui import Ui_ProxyCredsDialog
 
41
from ubuntu_sso.utils import compat
41
42
from ubuntu_sso.utils.ui import (
42
43
    CANCEL_BUTTON,
43
44
    PROXY_CREDS_DIALOG_TITLE,
109
110
    @defer.inlineCallbacks
110
111
    def _on_save_clicked(self, *args):
111
112
        """Save the new credentials."""
112
 
        username = unicode(self.ui.username_entry.text()).encode('utf8')
113
 
        password = unicode(self.ui.password_entry.text()).encode('utf8')
 
113
        username = compat.text_type(
 
114
                        self.ui.username_entry.text()).encode('utf8')
 
115
        password = compat.text_type(
 
116
                        self.ui.password_entry.text()).encode('utf8')
114
117
        creds = dict(username=username, password=password)
115
118
        # pylint: disable=W0703, W0612
116
119
        try: