Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Lib/gettext.py

    r2 r388  
    317317            # Unicode using the character encoding specified in the charset
    318318            # parameter of the Content-Type header.  The gettext documentation
    319             # strongly encourages msgids to be us-ascii, but some appliations
     319            # strongly encourages msgids to be us-ascii, but some applications
    320320            # require alternative encodings (e.g. Zope's ZCML and ZPT).  For
    321321            # traditional gettext applications, the msgid conversion will
     
    468468            return NullTranslations()
    469469        raise IOError(ENOENT, 'No translation file found for domain', domain)
    470     # TBD: do we need to worry about the file pointer getting collected?
    471470    # Avoid opening, reading, and parsing the .mo file after it's been done
    472471    # once.
    473472    result = None
    474473    for mofile in mofiles:
    475         key = os.path.abspath(mofile)
     474        key = (class_, os.path.abspath(mofile))
    476475        t = _translations.get(key)
    477476        if t is None:
    478             t = _translations.setdefault(key, class_(open(mofile, 'rb')))
     477            with open(mofile, 'rb') as fp:
     478                t = _translations.setdefault(key, class_(fp))
    479479        # Copy the translation object to allow setting fallbacks and
    480480        # output charset. All other instance data is shared with the
Note: See TracChangeset for help on using the changeset viewer.