~smoser/launchpadlib/trunk.lp-1685962

« back to all changes in this revision

Viewing changes to src/launchpadlib/credentials.py

  • Committer: Colin Watson
  • Date: 2015-11-17 15:40:53 UTC
  • Revision ID: cjwatson@canonical.com-20151117154053-yqg1b72dttqo0436
Fix browser token authorization on OS X.

Show diffs side-by-side

added added

removed removed

Lines of Context:
635
635
        self.output(self.WAITING_FOR_USER % authorization_url)
636
636
 
637
637
        try:
638
 
            browser = webbrowser.get().basename
 
638
            browser_obj = webbrowser.get()
 
639
            browser = getattr(browser_obj, "basename", None)
639
640
            console_browser = browser in self.TERMINAL_BROWSERS
640
641
        except webbrowser.Error:
641
642
            browser = None
650
651
                stdin.readline()
651
652
 
652
653
        self.output(self.WAITING_FOR_LAUNCHPAD)
653
 
        if browser is not None:
 
654
        if browser_obj is not None:
654
655
            webbrowser.open(authorization_url)
655
656
        start_time = time.time()
656
657
        while credentials.access_token is None: