~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2011-12-16 16:38:33 UTC
  • mto: This revision was merged to the branch mainline in revision 6387.
  • Revision ID: v.ladeuil+lp@free.fr-20111216163833-4igwmwi1dmxbbebw
Migrate add.maximum_file_size to the new config scheme

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
We hope you enjoy this library.
32
32
"""
33
33
 
34
 
from __future__ import absolute_import
35
 
 
36
34
import time
37
35
 
38
36
# Keep track of when bzrlib was first imported, so that we can give rough
46
44
IGNORE_FILENAME = ".bzrignore"
47
45
 
48
46
 
49
 
__copyright__ = "Copyright 2005-2012 Canonical Ltd."
 
47
__copyright__ = "Copyright 2005-2011 Canonical Ltd."
50
48
 
51
49
# same format as sys.version_info: "A tuple containing the five components of
52
50
# the version number: major, minor, micro, releaselevel, and serial. All
55
53
# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
56
54
# releaselevel of 'dev' for unreleased under-development code.
57
55
 
58
 
version_info = (2, 6, 0, 'dev', 1)
 
56
version_info = (2, 5, 0, 'dev', 5)
59
57
 
60
58
# API compatibility version
61
59
api_minimum_version = (2, 4, 0)
148
146
    """
149
147
    try:
150
148
        import ctypes
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
 
149
    except ImportError:
 
150
        return
 
151
    pythonapi = getattr(ctypes, "pythonapi", None)
 
152
    if pythonapi is None:
 
153
        # Not CPython ctypes implementation
 
154
        return
 
155
    old_ptr = ctypes.c_void_p.in_dll(pythonapi, "Py_FileSystemDefaultEncoding")
155
156
    new_ptr = ctypes.cast(ctypes.c_char_p(intern(new_enc)), ctypes.c_void_p)
156
157
    old_ptr.value = new_ptr.value
157
158
    if sys.getfilesystemencoding() != new_enc: