/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/lock.py

  • Committer: Martin
  • Date: 2017-06-05 23:54:45 UTC
  • mto: This revision was merged to the branch mainline in revision 6665.
  • Revision ID: gzlist@googlemail.com-20170605235445-iift8jtb1w2co7qx
Remove winver, win98 support code, and deprecated code

Show diffs side-by-side

added added

removed removed

Lines of Context:
345
345
 
346
346
 
347
347
if have_pywin32 and sys.platform == 'win32':
348
 
    if os.path.supports_unicode_filenames:
349
 
        # for Windows NT/2K/XP/etc
350
 
        win32file_CreateFile = win32file.CreateFileW
351
 
    else:
352
 
        # for Windows 98
353
 
        win32file_CreateFile = win32file.CreateFile
 
348
    win32file_CreateFile = win32file.CreateFileW
354
349
 
355
350
    class _w32c_FileLock(_OSLock):
356
351
 
423
418
    from ctypes.wintypes import DWORD, LPCSTR, LPCWSTR
424
419
    LPSECURITY_ATTRIBUTES = ctypes.c_void_p # used as NULL no need to declare
425
420
    HANDLE = ctypes.c_int # rather than unsigned as in ctypes.wintypes
426
 
    if os.path.supports_unicode_filenames:
427
 
        _function_name = "CreateFileW"
428
 
        LPTSTR = LPCWSTR
429
 
    else:
430
 
        _function_name = "CreateFileA"
431
 
        class LPTSTR(LPCSTR):
432
 
            def __new__(cls, obj):
433
 
                return LPCSTR.__new__(cls, obj.encode("mbcs"))
 
421
    _function_name = "CreateFileW"
434
422
 
435
423
    # CreateFile <http://msdn.microsoft.com/en-us/library/aa363858.aspx>
436
424
    _CreateFile = ctypes.WINFUNCTYPE(
437
425
            HANDLE,                # return value
438
 
            LPTSTR,                # lpFileName
 
426
            LPWSTR,                # lpFileName
439
427
            DWORD,                 # dwDesiredAccess
440
428
            DWORD,                 # dwShareMode
441
429
            LPSECURITY_ATTRIBUTES, # lpSecurityAttributes