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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
 
142
142
    :param base: plugins can specify their own local directory
143
143
    """
144
 
    if sys.version_info > (3,):
145
 
        decode_path = str
146
 
    else:
147
 
        fs_enc = sys.getfilesystemencoding()
148
 
 
149
 
        def decode_path(path):
150
 
            return path.decode(fs_enc)
151
144
    if getattr(sys, 'frozen', False):
152
145
        if base is None:
153
 
            base = os.path.dirname(decode_path(sys.executable))
 
146
            base = os.path.dirname(sys.executable)
154
147
        return os.path.join(base, u'locale')
155
148
    else:
156
149
        if base is None:
157
 
            base = os.path.dirname(decode_path(__file__))
 
150
            base = os.path.dirname(__file__)
158
151
        dirpath = os.path.realpath(os.path.join(base, u'locale'))
159
152
        if os.path.exists(dirpath):
160
153
            return dirpath
161
 
    return os.path.join(decode_path(sys.prefix), u"share", u"locale")
 
154
    return os.path.join(sys.prefix, u"share", u"locale")
162
155
 
163
156
 
164
157
def _check_win32_locale():