From ed303d89530b2aafaf1c8a95b2828d35dac7e006 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 7 Jul 2011 12:10:08 -0700 Subject: Remove the _ensure_encodings module. This was only needed for ancient versions of python built with USE=build since the ebuilds used to remove the encodings module in that case. Since the StreamWriter and StreamReader classes may be deprecated in the near future, now would be a good time to stop using them. --- pym/portage/__init__.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'pym/portage/__init__.py') diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index bc2eedb18..47e2e48e6 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -327,30 +327,6 @@ _python_interpreter = os.path.realpath(sys.executable) _bin_path = PORTAGE_BIN_PATH _pym_path = PORTAGE_PYM_PATH -def _ensure_default_encoding(): - - default_encoding = sys.getdefaultencoding().lower().replace('-', '_') - filesystem_encoding = _encodings['merge'].lower().replace('-', '_') - required_encodings = set(['ascii', 'utf_8']) - required_encodings.add(default_encoding) - required_encodings.add(filesystem_encoding) - missing_encodings = set() - for codec_name in required_encodings: - try: - codecs.lookup(codec_name) - except LookupError: - missing_encodings.add(codec_name) - - if not missing_encodings: - return - - from portage import _ensure_encodings - _ensure_encodings._setup_encodings(default_encoding, - filesystem_encoding, missing_encodings) - -# Do this ASAP since writemsg() might not work without it. -_ensure_default_encoding() - def _shell_quote(s): """ Quote a string in double-quotes and use backslashes to -- cgit v1.2.3-1-g7c22