/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2010-03-25 17:04:08 UTC
  • mto: This revision was merged to the branch mainline in revision 5116.
  • Revision ID: john@arbash-meinel.com-20100325170408-q9638awqluaqmq5i
Unbreak bzr on windows.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1812
1812
    If src is None, the containing directory is used as source. If chown
1813
1813
    fails, the error is ignored and a warning is printed.
1814
1814
    """
1815
 
    has_chown = getattr(os, 'chown')
1816
 
    if has_chown is None: return
 
1815
    chown = getattr(os, 'chown', None)
 
1816
    if chown is None:
 
1817
        return
1817
1818
 
1818
1819
    if src == None:
1819
1820
        src = os.path.dirname(dst)
1822
1823
 
1823
1824
    try:
1824
1825
        s = os.stat(src)
1825
 
        os.chown(dst, s.st_uid, s.st_gid)
 
1826
        chown(dst, s.st_uid, s.st_gid)
1826
1827
    except OSError, e:
1827
1828
        trace.warning("Unable to copy ownership from '%s' to '%s': IOError: %s." % (src, dst, e))
1828
1829