~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
IGNORE_FILENAME = ".bzrignore"
47
47
 
48
48
 
49
 
__copyright__ = "Copyright 2005-2011 Canonical Ltd."
 
49
__copyright__ = "Copyright 2005-2012 Canonical Ltd."
50
50
 
51
51
# same format as sys.version_info: "A tuple containing the five components of
52
52
# the version number: major, minor, micro, releaselevel, and serial. All
55
55
# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
56
56
# releaselevel of 'dev' for unreleased under-development code.
57
57
 
58
 
version_info = (2, 5, 0, 'dev', 5)
 
58
version_info = (2, 6, 0, 'dev', 1)
59
59
 
60
60
# API compatibility version
61
61
api_minimum_version = (2, 4, 0)
148
148
    """
149
149
    try:
150
150
        import ctypes
151
 
    except ImportError:
152
 
        return
153
 
    pythonapi = getattr(ctypes, "pythonapi", None)
154
 
    if pythonapi is None:
155
 
        # Not CPython ctypes implementation
156
 
        return
157
 
    old_ptr = ctypes.c_void_p.in_dll(pythonapi, "Py_FileSystemDefaultEncoding")
 
151
        old_ptr = ctypes.c_void_p.in_dll(ctypes.pythonapi,
 
152
            "Py_FileSystemDefaultEncoding")
 
153
    except (ImportError, ValueError):
 
154
        return # No ctypes or not CPython implementation, do nothing
158
155
    new_ptr = ctypes.cast(ctypes.c_char_p(intern(new_enc)), ctypes.c_void_p)
159
156
    old_ptr.value = new_ptr.value
160
157
    if sys.getfilesystemencoding() != new_enc: