~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

  • Committer: John Arbash Meinel
  • Date: 2005-12-02 04:16:07 UTC
  • mto: (1185.50.19 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1532.
  • Revision ID: john@arbash-meinel.com-20051202041607-e97ca8a3d0e7fd48
O_BINARY doesn't exist outside of win32, don't pass it if it isn't there.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
    def open(self, path, flags, attr):
95
95
        path = self._realpath(path)
96
96
        try:
97
 
            flags |= os.O_BINARY
 
97
            if hasattr(os, 'O_BINARY'):
 
98
                flags |= os.O_BINARY
98
99
            fd = os.open(path, flags)
99
100
        except OSError, e:
100
101
            return SFTPServer.convert_errno(e.errno)