Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1diff --git a/LICENSE.cpython b/LICENSE.cpython 2new file mode 100644 3index 0000000..14603b9 4--- /dev/null 5+++ b/LICENSE.cpython 6@@ -0,0 +1,277 @@ 7+A. HISTORY OF THE SOFTWARE 8+========================== 9+ 10+Python was created in the early 1990s by Guido van Rossum at Stichting 11+Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands 12+as a successor of a language called ABC. Guido remains Python's 13+principal author, although it includes many contributions from others. 14+ 15+In 1995, Guido continued his work on Python at the Corporation for 16+National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) 17+in Reston, Virginia where he released several versions of the 18+software. 19+ 20+In May 2000, Guido and the Python core development team moved to 21+BeOpen.com to form the BeOpen PythonLabs team. In October of the same 22+year, the PythonLabs team moved to Digital Creations, which became 23+Zope Corporation. In 2001, the Python Software Foundation (PSF, see 24+https://www.python.org/psf/) was formed, a non-profit organization 25+created specifically to own Python-related Intellectual Property. 26+Zope Corporation was a sponsoring member of the PSF. 27+ 28+All Python releases are Open Source (see https://opensource.org for 29+the Open Source Definition). Historically, most, but not all, Python 30+releases have also been GPL-compatible; the table below summarizes 31+the various releases. 32+ 33+ Release Derived Year Owner GPL- 34+ from compatible? (1) 35+ 36+ 0.9.0 thru 1.2 1991-1995 CWI yes 37+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes 38+ 1.6 1.5.2 2000 CNRI no 39+ 2.0 1.6 2000 BeOpen.com no 40+ 1.6.1 1.6 2001 CNRI yes (2) 41+ 2.1 2.0+1.6.1 2001 PSF no 42+ 2.0.1 2.0+1.6.1 2001 PSF yes 43+ 2.1.1 2.1+2.0.1 2001 PSF yes 44+ 2.1.2 2.1.1 2002 PSF yes 45+ 2.1.3 2.1.2 2002 PSF yes 46+ 2.2 and above 2.1.1 2001-now PSF yes 47+ 48+Footnotes: 49+ 50+(1) GPL-compatible doesn't mean that we're distributing Python under 51+ the GPL. All Python licenses, unlike the GPL, let you distribute 52+ a modified version without making your changes open source. The 53+ GPL-compatible licenses make it possible to combine Python with 54+ other software that is released under the GPL; the others don't. 55+ 56+(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, 57+ because its license has a choice of law clause. According to 58+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 59+ is "not incompatible" with the GPL. 60+ 61+Thanks to the many outside volunteers who have worked under Guido's 62+direction to make these releases possible. 63+ 64+ 65+B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON 66+=============================================================== 67+ 68+Python software and documentation are licensed under the 69+Python Software Foundation License Version 2. 70+ 71+Starting with Python 3.8.6, examples, recipes, and other code in 72+the documentation are dual licensed under the PSF License Version 2 73+and the Zero-Clause BSD license. 74+ 75+Some software incorporated into Python is under different licenses. 76+The licenses are listed with code falling under that license. 77+ 78+ 79+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 80+-------------------------------------------- 81+ 82+1. This LICENSE AGREEMENT is between the Python Software Foundation 83+("PSF"), and the Individual or Organization ("Licensee") accessing and 84+otherwise using this software ("Python") in source or binary form and 85+its associated documentation. 86+ 87+2. Subject to the terms and conditions of this License Agreement, PSF hereby 88+grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, 89+analyze, test, perform and/or display publicly, prepare derivative works, 90+distribute, and otherwise use Python alone or in any derivative version, 91+provided, however, that PSF's License Agreement and PSF's notice of copyright, 92+i.e., "Copyright (c) 2001-2024 Python Software Foundation; All Rights Reserved" 93+are retained in Python alone or in any derivative version prepared by Licensee. 94+ 95+3. In the event Licensee prepares a derivative work that is based on 96+or incorporates Python or any part thereof, and wants to make 97+the derivative work available to others as provided herein, then 98+Licensee hereby agrees to include in any such work a brief summary of 99+the changes made to Python. 100+ 101+4. PSF is making Python available to Licensee on an "AS IS" 102+basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR 103+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND 104+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS 105+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT 106+INFRINGE ANY THIRD PARTY RIGHTS. 107+ 108+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 109+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS 110+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, 111+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 112+ 113+6. This License Agreement will automatically terminate upon a material 114+breach of its terms and conditions. 115+ 116+7. Nothing in this License Agreement shall be deemed to create any 117+relationship of agency, partnership, or joint venture between PSF and 118+Licensee. This License Agreement does not grant permission to use PSF 119+trademarks or trade name in a trademark sense to endorse or promote 120+products or services of Licensee, or any third party. 121+ 122+8. By copying, installing or otherwise using Python, Licensee 123+agrees to be bound by the terms and conditions of this License 124+Agreement. 125+ 126+ 127+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 128+------------------------------------------- 129+ 130+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 131+ 132+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an 133+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the 134+Individual or Organization ("Licensee") accessing and otherwise using 135+this software in source or binary form and its associated 136+documentation ("the Software"). 137+ 138+2. Subject to the terms and conditions of this BeOpen Python License 139+Agreement, BeOpen hereby grants Licensee a non-exclusive, 140+royalty-free, world-wide license to reproduce, analyze, test, perform 141+and/or display publicly, prepare derivative works, distribute, and 142+otherwise use the Software alone or in any derivative version, 143+provided, however, that the BeOpen Python License is retained in the 144+Software, alone or in any derivative version prepared by Licensee. 145+ 146+3. BeOpen is making the Software available to Licensee on an "AS IS" 147+basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR 148+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND 149+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS 150+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT 151+INFRINGE ANY THIRD PARTY RIGHTS. 152+ 153+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE 154+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS 155+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY 156+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 157+ 158+5. This License Agreement will automatically terminate upon a material 159+breach of its terms and conditions. 160+ 161+6. This License Agreement shall be governed by and interpreted in all 162+respects by the law of the State of California, excluding conflict of 163+law provisions. Nothing in this License Agreement shall be deemed to 164+create any relationship of agency, partnership, or joint venture 165+between BeOpen and Licensee. This License Agreement does not grant 166+permission to use BeOpen trademarks or trade names in a trademark 167+sense to endorse or promote products or services of Licensee, or any 168+third party. As an exception, the "BeOpen Python" logos available at 169+http://www.pythonlabs.com/logos.html may be used according to the 170+permissions granted on that web page. 171+ 172+7. By copying, installing or otherwise using the software, Licensee 173+agrees to be bound by the terms and conditions of this License 174+Agreement. 175+ 176+ 177+CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 178+--------------------------------------- 179+ 180+1. This LICENSE AGREEMENT is between the Corporation for National 181+Research Initiatives, having an office at 1895 Preston White Drive, 182+Reston, VA 20191 ("CNRI"), and the Individual or Organization 183+("Licensee") accessing and otherwise using Python 1.6.1 software in 184+source or binary form and its associated documentation. 185+ 186+2. Subject to the terms and conditions of this License Agreement, CNRI 187+hereby grants Licensee a nonexclusive, royalty-free, world-wide 188+license to reproduce, analyze, test, perform and/or display publicly, 189+prepare derivative works, distribute, and otherwise use Python 1.6.1 190+alone or in any derivative version, provided, however, that CNRI's 191+License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) 192+1995-2001 Corporation for National Research Initiatives; All Rights 193+Reserved" are retained in Python 1.6.1 alone or in any derivative 194+version prepared by Licensee. Alternately, in lieu of CNRI's License 195+Agreement, Licensee may substitute the following text (omitting the 196+quotes): "Python 1.6.1 is made available subject to the terms and 197+conditions in CNRI's License Agreement. This Agreement together with 198+Python 1.6.1 may be located on the internet using the following 199+unique, persistent identifier (known as a handle): 1895.22/1013. This 200+Agreement may also be obtained from a proxy server on the internet 201+using the following URL: http://hdl.handle.net/1895.22/1013". 202+ 203+3. In the event Licensee prepares a derivative work that is based on 204+or incorporates Python 1.6.1 or any part thereof, and wants to make 205+the derivative work available to others as provided herein, then 206+Licensee hereby agrees to include in any such work a brief summary of 207+the changes made to Python 1.6.1. 208+ 209+4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" 210+basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR 211+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND 212+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS 213+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT 214+INFRINGE ANY THIRD PARTY RIGHTS. 215+ 216+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 217+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS 218+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, 219+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 220+ 221+6. This License Agreement will automatically terminate upon a material 222+breach of its terms and conditions. 223+ 224+7. This License Agreement shall be governed by the federal 225+intellectual property law of the United States, including without 226+limitation the federal copyright law, and, to the extent such 227+U.S. federal law does not apply, by the law of the Commonwealth of 228+Virginia, excluding Virginia's conflict of law provisions. 229+Notwithstanding the foregoing, with regard to derivative works based 230+on Python 1.6.1 that incorporate non-separable material that was 231+previously distributed under the GNU General Public License (GPL), the 232+law of the Commonwealth of Virginia shall govern this License 233+Agreement only as to issues arising under or with respect to 234+Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this 235+License Agreement shall be deemed to create any relationship of 236+agency, partnership, or joint venture between CNRI and Licensee. This 237+License Agreement does not grant permission to use CNRI trademarks or 238+trade name in a trademark sense to endorse or promote products or 239+services of Licensee, or any third party. 240+ 241+8. By clicking on the "ACCEPT" button where indicated, or by copying, 242+installing or otherwise using Python 1.6.1, Licensee agrees to be 243+bound by the terms and conditions of this License Agreement. 244+ 245+ ACCEPT 246+ 247+ 248+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 249+-------------------------------------------------- 250+ 251+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, 252+The Netherlands. All rights reserved. 253+ 254+Permission to use, copy, modify, and distribute this software and its 255+documentation for any purpose and without fee is hereby granted, 256+provided that the above copyright notice appear in all copies and that 257+both that copyright notice and this permission notice appear in 258+supporting documentation, and that the name of Stichting Mathematisch 259+Centrum or CWI not be used in advertising or publicity pertaining to 260+distribution of the software without specific, written prior 261+permission. 262+ 263+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO 264+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 265+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE 266+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 267+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 268+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 269+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 270+ 271+ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION 272+---------------------------------------------------------------------- 273+ 274+Permission to use, copy, modify, and/or distribute this software for any 275+purpose with or without fee is hereby granted. 276+ 277+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 278+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 279+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 280+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 281+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 282+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 283+PERFORMANCE OF THIS SOFTWARE. 284diff --git a/nose/importer.py b/nose/importer.py 285index e677658..77099eb 100644 286--- a/nose/importer.py 287+++ b/nose/importer.py 288@@ -7,9 +7,10 @@ the builtin importer. 289 import logging 290 import os 291 import sys 292+import tokenize 293 from nose.config import Config 294- 295-from imp import find_module, load_module, acquire_lock, release_lock 296+from importlib import _imp 297+from importlib import machinery 298 299 log = logging.getLogger(__name__) 300 301@@ -20,6 +21,244 @@ except AttributeError: 302 return (os.path.normcase(os.path.realpath(src)) == 303 os.path.normcase(os.path.realpath(dst))) 304 305+################################################################################ 306+# BEGIN IMPORTLIB SHIMS 307+################################################################################ 308+ 309+# Adapted from the CPython 3.11 imp.py code. 310+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; All Rights Reserved 311+# Originally licensed under the PSLv2 (see LICENSE.cpython) and incorporated under the LGPL 2.1 (see lgpl.txt). 312+ 313+try: 314+ from _imp import create_dynamic 315+except ImportError: 316+ # Platform doesn't support dynamic loading. 317+ create_dynamic = None 318+ 319+from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name 320+from importlib._bootstrap_external import SourcelessFileLoader 321+ 322+from importlib import machinery 323+from importlib import util 324+import importlib 325+import os 326+import sys 327+import tokenize 328+import types 329+ 330+ 331+SEARCH_ERROR = 0 332+PY_SOURCE = 1 333+PY_COMPILED = 2 334+C_EXTENSION = 3 335+PY_RESOURCE = 4 336+PKG_DIRECTORY = 5 337+C_BUILTIN = 6 338+PY_FROZEN = 7 339+PY_CODERESOURCE = 8 340+IMP_HOOK = 9 341+ 342+ 343+def get_suffixes(): 344+ extensions = [(s, 'rb', C_EXTENSION) for s in machinery.EXTENSION_SUFFIXES] 345+ source = [(s, 'r', PY_SOURCE) for s in machinery.SOURCE_SUFFIXES] 346+ bytecode = [(s, 'rb', PY_COMPILED) for s in machinery.BYTECODE_SUFFIXES] 347+ 348+ return extensions + source + bytecode 349+ 350+ 351+class _HackedGetData: 352+ 353+ """Compatibility support for 'file' arguments of various load_*() 354+ functions.""" 355+ 356+ def __init__(self, fullname, path, file=None): 357+ super().__init__(fullname, path) 358+ self.file = file 359+ 360+ def get_data(self, path): 361+ """Gross hack to contort loader to deal w/ load_*()'s bad API.""" 362+ if self.file and path == self.path: 363+ # The contract of get_data() requires us to return bytes. Reopen the 364+ # file in binary mode if needed. 365+ if not self.file.closed: 366+ file = self.file 367+ if 'b' not in file.mode: 368+ file.close() 369+ if self.file.closed: 370+ self.file = file = open(self.path, 'rb') 371+ 372+ with file: 373+ return file.read() 374+ else: 375+ return super().get_data(path) 376+ 377+ 378+class _LoadSourceCompatibility(_HackedGetData, machinery.SourceFileLoader): 379+ 380+ """Compatibility support for implementing load_source().""" 381+ 382+ 383+def load_source(name, pathname, file=None): 384+ loader = _LoadSourceCompatibility(name, pathname, file) 385+ spec = util.spec_from_file_location(name, pathname, loader=loader) 386+ if name in sys.modules: 387+ module = _exec(spec, sys.modules[name]) 388+ else: 389+ module = _load(spec) 390+ # To allow reloading to potentially work, use a non-hacked loader which 391+ # won't rely on a now-closed file object. 392+ module.__loader__ = machinery.SourceFileLoader(name, pathname) 393+ module.__spec__.loader = module.__loader__ 394+ return module 395+ 396+ 397+class _LoadCompiledCompatibility(_HackedGetData, SourcelessFileLoader): 398+ 399+ """Compatibility support for implementing load_compiled().""" 400+ 401+ 402+def load_compiled(name, pathname, file=None): 403+ loader = _LoadCompiledCompatibility(name, pathname, file) 404+ spec = util.spec_from_file_location(name, pathname, loader=loader) 405+ if name in sys.modules: 406+ module = _exec(spec, sys.modules[name]) 407+ else: 408+ module = _load(spec) 409+ # To allow reloading to potentially work, use a non-hacked loader which 410+ # won't rely on a now-closed file object. 411+ module.__loader__ = SourcelessFileLoader(name, pathname) 412+ module.__spec__.loader = module.__loader__ 413+ return module 414+ 415+ 416+def load_package(name, path): 417+ if os.path.isdir(path): 418+ extensions = (machinery.SOURCE_SUFFIXES[:] + 419+ machinery.BYTECODE_SUFFIXES[:]) 420+ for extension in extensions: 421+ init_path = os.path.join(path, '__init__' + extension) 422+ if os.path.exists(init_path): 423+ path = init_path 424+ break 425+ else: 426+ raise ValueError('{!r} is not a package'.format(path)) 427+ spec = util.spec_from_file_location(name, path, 428+ submodule_search_locations=[]) 429+ if name in sys.modules: 430+ return _exec(spec, sys.modules[name]) 431+ else: 432+ return _load(spec) 433+ 434+ 435+def load_module(name, file, filename, details): 436+ """ 437+ 438+ Load a module, given information returned by find_module(). 439+ 440+ The module name must include the full package name, if any. 441+ 442+ """ 443+ suffix, mode, type_ = details 444+ if mode and (not mode.startswith('r') or '+' in mode): 445+ raise ValueError('invalid file open mode {!r}'.format(mode)) 446+ elif file is None and type_ in {PY_SOURCE, PY_COMPILED}: 447+ msg = 'file object required for import (type code {})'.format(type_) 448+ raise ValueError(msg) 449+ elif type_ == PY_SOURCE: 450+ return load_source(name, filename, file) 451+ elif type_ == PY_COMPILED: 452+ return load_compiled(name, filename, file) 453+ elif type_ == PKG_DIRECTORY: 454+ return load_package(name, filename) 455+ elif type_ == C_BUILTIN: 456+ return init_builtin(name) 457+ elif type_ == PY_FROZEN: 458+ return _imp.init_frozen(name) 459+ else: 460+ msg = "Don't know how to import {} (type code {})".format(name, type_) 461+ raise ImportError(msg, name=name) 462+ 463+ 464+def find_module(name, path=None): 465+ """ 466+ 467+ Search for a module. 468+ 469+ If path is omitted or None, search for a built-in, frozen or special 470+ module and continue search in sys.path. The module name cannot 471+ contain '.'; to search for a submodule of a package, pass the 472+ submodule name and the package's __path__. 473+ 474+ """ 475+ if not isinstance(name, str): 476+ raise TypeError("'name' must be a str, not {}".format(type(name))) 477+ elif not isinstance(path, (type(None), list)): 478+ # Backwards-compatibility 479+ raise RuntimeError("'path' must be None or a list, " 480+ "not {}".format(type(path))) 481+ 482+ if path is None: 483+ if _imp.is_builtin(name): 484+ return None, None, ('', '', C_BUILTIN) 485+ elif _imp.is_frozen(name): 486+ return None, None, ('', '', PY_FROZEN) 487+ else: 488+ path = sys.path 489+ 490+ for entry in path: 491+ package_directory = os.path.join(entry, name) 492+ for suffix in ['.py', machinery.BYTECODE_SUFFIXES[0]]: 493+ package_file_name = '__init__' + suffix 494+ file_path = os.path.join(package_directory, package_file_name) 495+ if os.path.isfile(file_path): 496+ return None, package_directory, ('', '', PKG_DIRECTORY) 497+ for suffix, mode, type_ in get_suffixes(): 498+ file_name = name + suffix 499+ file_path = os.path.join(entry, file_name) 500+ if os.path.isfile(file_path): 501+ break 502+ else: 503+ continue 504+ break # Break out of outer loop when breaking out of inner loop. 505+ else: 506+ raise ImportError(_ERR_MSG.format(name), name=name) 507+ 508+ encoding = None 509+ if 'b' not in mode: 510+ with open(file_path, 'rb') as file: 511+ encoding = tokenize.detect_encoding(file.readline)[0] 512+ file = open(file_path, mode, encoding=encoding) 513+ return file, file_path, (suffix, mode, type_) 514+ 515+ 516+def reload(module): 517+ """ 518+ 519+ Reload the module and return it. 520+ 521+ The module must have been successfully imported before. 522+ 523+ """ 524+ return importlib.reload(module) 525+ 526+ 527+def init_builtin(name): 528+ """ 529+ 530+ Load and return a built-in module by name, or None is such module doesn't 531+ exist 532+ """ 533+ try: 534+ return _builtin_from_name(name) 535+ except ImportError: 536+ return None 537+ 538+ 539+################################################################################ 540+# END IMPORTLIB SHIMS 541+################################################################################ 542+ 543 544 class Importer(object): 545 """An importer class that does only path-specific imports. That 546@@ -73,7 +312,7 @@ class Importer(object): 547 else: 548 part_fqname = "%s.%s" % (part_fqname, part) 549 try: 550- acquire_lock() 551+ _imp.acquire_lock() 552 log.debug("find module part %s (%s) in %s", 553 part, part_fqname, path) 554 fh, filename, desc = find_module(part, path) 555@@ -95,7 +334,7 @@ class Importer(object): 556 finally: 557 if fh: 558 fh.close() 559- release_lock() 560+ _imp.release_lock() 561 if parent: 562 setattr(parent, part, mod) 563 if hasattr(mod, '__path__'): 564diff --git a/nose/result.py b/nose/result.py 565index f974a14..228a42c 100644 566--- a/nose/result.py 567+++ b/nose/result.py 568@@ -13,7 +13,7 @@ try: 569 # 2.7+ 570 from unittest.runner import _TextTestResult 571 except ImportError: 572- from unittest import _TextTestResult 573+ from unittest import TextTestResult as _TextTestResult 574 from nose.config import Config 575 from nose.util import isclass, ln as _ln # backwards compat 576