~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Martin Packman
  • Date: 2011-12-14 18:27:44 UTC
  • mto: This revision was merged to the branch mainline in revision 6369.
  • Revision ID: martin.packman@canonical.com-20111214182744-my73qn3nkrxspyel
Tweaks including those suggested by vila in review

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    if winver == 'Windows 98':
69
69
        create_buffer = ctypes.create_string_buffer
70
70
        def extract_buffer(buf):
71
 
            return buf.val.decode("mbcs")
 
71
            return buf.value.decode("mbcs")
72
72
        suffix = 'A'
73
73
    else:
74
74
        create_buffer = ctypes.create_unicode_buffer
557
557
    def get_environ_unicode(key, default=None):
558
558
        """Get `key` from environment as unicode or `default` if unset
559
559
 
 
560
        The environment is natively unicode on modern windows versions but
 
561
        Python 2 only accesses it through the legacy bytestring api.
 
562
 
 
563
        Environmental variable names are case insenstive on Windows.
 
564
 
560
565
        A large enough buffer will be allocated to retrieve the value, though
561
566
        it may take two calls to the underlying library function.
562
567