/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 breezy/win32utils.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
@symbol_versioning.deprecated_function(
376
376
    symbol_versioning.deprecated_in((2, 5, 0)))
377
377
def _ensure_unicode(s):
378
 
    if s and type(s) != unicode:
379
 
        from breezy import osutils
 
378
    if s and not isinstance(s, unicode):
 
379
        from . import osutils
380
380
        s = s.decode(osutils.get_user_encoding())
381
381
    return s
382
382
 
497
497
            SetFileAttributes = win32file.SetFileAttributes
498
498
        try:
499
499
            SetFileAttributes(path, win32file.FILE_ATTRIBUTE_HIDDEN)
500
 
        except pywintypes.error, e:
501
 
            from breezy import trace
 
500
        except pywintypes.error as e:
 
501
            from . import trace
502
502
            trace.mutter('Unable to set hidden attribute on %r: %s', path, e)
503
503
 
504
504
 
606
606
        """True if pid doesn't correspond to live process on this machine"""
607
607
        try:
608
608
            handle = win32api.OpenProcess(1, False, pid) # PROCESS_TERMINATE
609
 
        except pywintypes.error, e:
 
609
        except pywintypes.error as e:
610
610
            if e[0] == 5: # ERROR_ACCESS_DENIED
611
611
                # Probably something alive we're not allowed to kill
612
612
                return False