~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: Robert J. Tanner
  • Date: 2009-06-10 03:56:49 UTC
  • mfrom: (4423 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4425.
  • Revision ID: tanner@real-time.com-20090610035649-7rfx4cls4550zc3c
Merge 1.15.1 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2009 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
63
63
            ## mutter("trying editor: %r", (edargs +[filename]))
64
64
            x = call(edargs + [filename])
65
65
        except OSError, e:
66
 
            if candidate_source is not None:
67
 
                # We tried this editor because some user configuration (an
68
 
                # environment variable or config file) said to try it.  Let
69
 
                # the user know their configuration is broken.
70
 
                trace.warning(
71
 
                    'Could not start editor "%s" (specified by %s): %s\n'
72
 
                    % (candidate, candidate_source, str(e)))
73
 
            continue
 
66
            # We're searching for an editor, so catch safe errors and continue
 
67
            if e.errno in (errno.ENOENT, errno.EACCES):
 
68
                if candidate_source is not None:
 
69
                    # We tried this editor because some user configuration (an
 
70
                    # environment variable or config file) said to try it.  Let
 
71
                    # the user know their configuration is broken.
 
72
                    trace.warning(
 
73
                        'Could not start editor "%s" (specified by %s): %s\n'
 
74
                        % (candidate, candidate_source, str(e)))
 
75
                continue
74
76
            raise
75
77
        if x == 0:
76
78
            return True