@tedbrain/vlink 0.0.0-dpv2.ted-runner.python-linux-x64.3.9.0-dpv2.1.r6 → 0.0.0-dpv2.ted-runner.vlink-linux-x64.0.2.24.r6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (660) hide show
  1. package/bin/vlink +0 -0
  2. package/package.json +1 -1
  3. package/bin/python3 +0 -0
  4. package/lib/libX11.so.6 +0 -0
  5. package/lib/libXau.so.6 +0 -0
  6. package/lib/libXdmcp.so.6 +0 -0
  7. package/lib/libcrypt.so.1 +0 -0
  8. package/lib/libcrypto.so.1.1 +0 -0
  9. package/lib/libffi.so.7 +0 -0
  10. package/lib/libfreebl3.so +0 -0
  11. package/lib/liblzma.so.5 +0 -0
  12. package/lib/libncursesw.so.6 +0 -0
  13. package/lib/libnsl.so.1 +0 -0
  14. package/lib/libpanelw.so.6 +0 -0
  15. package/lib/libpython3.9.so.1.0 +0 -0
  16. package/lib/libreadline.so.8 +0 -0
  17. package/lib/libsqlite3.so.0 +0 -0
  18. package/lib/libssl.so.1.1 +0 -0
  19. package/lib/libtcl8.6.so +0 -0
  20. package/lib/libtinfow.so.6 +0 -0
  21. package/lib/libtk8.6.so +0 -0
  22. package/lib/libxcb.so.1 +0 -0
  23. package/lib/libz.so.1 +0 -0
  24. package/lib/python3.9/LICENSE.txt +0 -279
  25. package/lib/python3.9/__future__.py +0 -147
  26. package/lib/python3.9/__phello__.foo.py +0 -1
  27. package/lib/python3.9/_aix_support.py +0 -89
  28. package/lib/python3.9/_bootlocale.py +0 -46
  29. package/lib/python3.9/_bootsubprocess.py +0 -97
  30. package/lib/python3.9/_collections_abc.py +0 -1031
  31. package/lib/python3.9/_compat_pickle.py +0 -251
  32. package/lib/python3.9/_compression.py +0 -152
  33. package/lib/python3.9/_markupbase.py +0 -395
  34. package/lib/python3.9/_osx_support.py +0 -515
  35. package/lib/python3.9/_py_abc.py +0 -147
  36. package/lib/python3.9/_pydecimal.py +0 -6410
  37. package/lib/python3.9/_pyio.py +0 -2692
  38. package/lib/python3.9/_sitebuiltins.py +0 -103
  39. package/lib/python3.9/_strptime.py +0 -579
  40. package/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py +0 -969
  41. package/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py.orig +0 -969
  42. package/lib/python3.9/_sysconfigdata_x86_64_conda_cos6_linux_gnu.py +0 -969
  43. package/lib/python3.9/_threading_local.py +0 -242
  44. package/lib/python3.9/_weakrefset.py +0 -202
  45. package/lib/python3.9/abc.py +0 -129
  46. package/lib/python3.9/aifc.py +0 -947
  47. package/lib/python3.9/antigravity.py +0 -17
  48. package/lib/python3.9/argparse.py +0 -2575
  49. package/lib/python3.9/ast.py +0 -1530
  50. package/lib/python3.9/asynchat.py +0 -307
  51. package/lib/python3.9/asyncio/__init__.py +0 -47
  52. package/lib/python3.9/asyncio/__main__.py +0 -125
  53. package/lib/python3.9/asyncio/base_events.py +0 -1915
  54. package/lib/python3.9/asyncio/base_futures.py +0 -61
  55. package/lib/python3.9/asyncio/base_subprocess.py +0 -285
  56. package/lib/python3.9/asyncio/base_tasks.py +0 -85
  57. package/lib/python3.9/asyncio/constants.py +0 -27
  58. package/lib/python3.9/asyncio/coroutines.py +0 -269
  59. package/lib/python3.9/asyncio/events.py +0 -795
  60. package/lib/python3.9/asyncio/exceptions.py +0 -57
  61. package/lib/python3.9/asyncio/format_helpers.py +0 -76
  62. package/lib/python3.9/asyncio/futures.py +0 -423
  63. package/lib/python3.9/asyncio/locks.py +0 -451
  64. package/lib/python3.9/asyncio/log.py +0 -7
  65. package/lib/python3.9/asyncio/proactor_events.py +0 -868
  66. package/lib/python3.9/asyncio/protocols.py +0 -220
  67. package/lib/python3.9/asyncio/queues.py +0 -252
  68. package/lib/python3.9/asyncio/runners.py +0 -74
  69. package/lib/python3.9/asyncio/selector_events.py +0 -1099
  70. package/lib/python3.9/asyncio/sslproto.py +0 -733
  71. package/lib/python3.9/asyncio/staggered.py +0 -149
  72. package/lib/python3.9/asyncio/streams.py +0 -741
  73. package/lib/python3.9/asyncio/subprocess.py +0 -241
  74. package/lib/python3.9/asyncio/tasks.py +0 -980
  75. package/lib/python3.9/asyncio/threads.py +0 -25
  76. package/lib/python3.9/asyncio/transports.py +0 -329
  77. package/lib/python3.9/asyncio/trsock.py +0 -206
  78. package/lib/python3.9/asyncio/unix_events.py +0 -1466
  79. package/lib/python3.9/asyncio/windows_events.py +0 -908
  80. package/lib/python3.9/asyncio/windows_utils.py +0 -173
  81. package/lib/python3.9/asyncore.py +0 -642
  82. package/lib/python3.9/base64.py +0 -579
  83. package/lib/python3.9/bdb.py +0 -864
  84. package/lib/python3.9/binhex.py +0 -502
  85. package/lib/python3.9/bisect.py +0 -80
  86. package/lib/python3.9/bz2.py +0 -350
  87. package/lib/python3.9/cProfile.py +0 -180
  88. package/lib/python3.9/calendar.py +0 -770
  89. package/lib/python3.9/cgi.py +0 -996
  90. package/lib/python3.9/cgitb.py +0 -321
  91. package/lib/python3.9/chunk.py +0 -169
  92. package/lib/python3.9/cmd.py +0 -401
  93. package/lib/python3.9/code.py +0 -315
  94. package/lib/python3.9/codecs.py +0 -1126
  95. package/lib/python3.9/codeop.py +0 -178
  96. package/lib/python3.9/collections/__init__.py +0 -1508
  97. package/lib/python3.9/collections/abc.py +0 -2
  98. package/lib/python3.9/colorsys.py +0 -164
  99. package/lib/python3.9/compileall.py +0 -461
  100. package/lib/python3.9/concurrent/__init__.py +0 -1
  101. package/lib/python3.9/concurrent/futures/__init__.py +0 -53
  102. package/lib/python3.9/concurrent/futures/_base.py +0 -635
  103. package/lib/python3.9/concurrent/futures/process.py +0 -751
  104. package/lib/python3.9/concurrent/futures/thread.py +0 -230
  105. package/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile +0 -2015
  106. package/lib/python3.9/config-3.9-x86_64-linux-gnu/Setup +0 -372
  107. package/lib/python3.9/config-3.9-x86_64-linux-gnu/Setup.local +0 -1
  108. package/lib/python3.9/config-3.9-x86_64-linux-gnu/config.c +0 -116
  109. package/lib/python3.9/config-3.9-x86_64-linux-gnu/config.c.in +0 -67
  110. package/lib/python3.9/config-3.9-x86_64-linux-gnu/install-sh +0 -518
  111. package/lib/python3.9/config-3.9-x86_64-linux-gnu/makesetup +0 -309
  112. package/lib/python3.9/config-3.9-x86_64-linux-gnu/python-config.py +0 -74
  113. package/lib/python3.9/config-3.9-x86_64-linux-gnu/python.o +0 -0
  114. package/lib/python3.9/configparser.py +0 -1363
  115. package/lib/python3.9/contextlib.py +0 -676
  116. package/lib/python3.9/contextvars.py +0 -4
  117. package/lib/python3.9/copy.py +0 -303
  118. package/lib/python3.9/copyreg.py +0 -209
  119. package/lib/python3.9/crypt.py +0 -120
  120. package/lib/python3.9/csv.py +0 -448
  121. package/lib/python3.9/ctypes/__init__.py +0 -571
  122. package/lib/python3.9/ctypes/_aix.py +0 -331
  123. package/lib/python3.9/ctypes/_endian.py +0 -61
  124. package/lib/python3.9/ctypes/macholib/README.ctypes +0 -7
  125. package/lib/python3.9/ctypes/macholib/__init__.py +0 -9
  126. package/lib/python3.9/ctypes/macholib/dyld.py +0 -182
  127. package/lib/python3.9/ctypes/macholib/dylib.py +0 -63
  128. package/lib/python3.9/ctypes/macholib/fetch_macholib +0 -2
  129. package/lib/python3.9/ctypes/macholib/fetch_macholib.bat +0 -1
  130. package/lib/python3.9/ctypes/macholib/framework.py +0 -65
  131. package/lib/python3.9/ctypes/util.py +0 -379
  132. package/lib/python3.9/ctypes/wintypes.py +0 -202
  133. package/lib/python3.9/curses/__init__.py +0 -101
  134. package/lib/python3.9/curses/ascii.py +0 -99
  135. package/lib/python3.9/curses/has_key.py +0 -192
  136. package/lib/python3.9/curses/panel.py +0 -6
  137. package/lib/python3.9/curses/textpad.py +0 -201
  138. package/lib/python3.9/dataclasses.py +0 -1284
  139. package/lib/python3.9/datetime.py +0 -2555
  140. package/lib/python3.9/dbm/__init__.py +0 -189
  141. package/lib/python3.9/dbm/dumb.py +0 -316
  142. package/lib/python3.9/dbm/gnu.py +0 -3
  143. package/lib/python3.9/dbm/ndbm.py +0 -3
  144. package/lib/python3.9/decimal.py +0 -11
  145. package/lib/python3.9/difflib.py +0 -2096
  146. package/lib/python3.9/dis.py +0 -553
  147. package/lib/python3.9/distutils/README +0 -11
  148. package/lib/python3.9/distutils/__init__.py +0 -13
  149. package/lib/python3.9/distutils/_msvccompiler.py +0 -546
  150. package/lib/python3.9/distutils/archive_util.py +0 -256
  151. package/lib/python3.9/distutils/bcppcompiler.py +0 -393
  152. package/lib/python3.9/distutils/ccompiler.py +0 -1116
  153. package/lib/python3.9/distutils/cmd.py +0 -403
  154. package/lib/python3.9/distutils/command/__init__.py +0 -31
  155. package/lib/python3.9/distutils/command/bdist.py +0 -143
  156. package/lib/python3.9/distutils/command/bdist_dumb.py +0 -123
  157. package/lib/python3.9/distutils/command/bdist_msi.py +0 -749
  158. package/lib/python3.9/distutils/command/bdist_rpm.py +0 -579
  159. package/lib/python3.9/distutils/command/bdist_wininst.py +0 -377
  160. package/lib/python3.9/distutils/command/build.py +0 -157
  161. package/lib/python3.9/distutils/command/build_clib.py +0 -209
  162. package/lib/python3.9/distutils/command/build_ext.py +0 -754
  163. package/lib/python3.9/distutils/command/build_py.py +0 -416
  164. package/lib/python3.9/distutils/command/build_scripts.py +0 -160
  165. package/lib/python3.9/distutils/command/check.py +0 -148
  166. package/lib/python3.9/distutils/command/clean.py +0 -76
  167. package/lib/python3.9/distutils/command/command_template +0 -33
  168. package/lib/python3.9/distutils/command/config.py +0 -344
  169. package/lib/python3.9/distutils/command/install.py +0 -657
  170. package/lib/python3.9/distutils/command/install_data.py +0 -79
  171. package/lib/python3.9/distutils/command/install_egg_info.py +0 -77
  172. package/lib/python3.9/distutils/command/install_headers.py +0 -47
  173. package/lib/python3.9/distutils/command/install_lib.py +0 -217
  174. package/lib/python3.9/distutils/command/install_scripts.py +0 -60
  175. package/lib/python3.9/distutils/command/register.py +0 -304
  176. package/lib/python3.9/distutils/command/sdist.py +0 -494
  177. package/lib/python3.9/distutils/command/upload.py +0 -214
  178. package/lib/python3.9/distutils/config.py +0 -130
  179. package/lib/python3.9/distutils/core.py +0 -234
  180. package/lib/python3.9/distutils/cygwinccompiler.py +0 -410
  181. package/lib/python3.9/distutils/debug.py +0 -5
  182. package/lib/python3.9/distutils/dep_util.py +0 -92
  183. package/lib/python3.9/distutils/dir_util.py +0 -210
  184. package/lib/python3.9/distutils/dist.py +0 -1256
  185. package/lib/python3.9/distutils/errors.py +0 -97
  186. package/lib/python3.9/distutils/extension.py +0 -240
  187. package/lib/python3.9/distutils/fancy_getopt.py +0 -457
  188. package/lib/python3.9/distutils/file_util.py +0 -238
  189. package/lib/python3.9/distutils/filelist.py +0 -327
  190. package/lib/python3.9/distutils/log.py +0 -77
  191. package/lib/python3.9/distutils/msvc9compiler.py +0 -788
  192. package/lib/python3.9/distutils/msvccompiler.py +0 -643
  193. package/lib/python3.9/distutils/spawn.py +0 -125
  194. package/lib/python3.9/distutils/sysconfig.py +0 -560
  195. package/lib/python3.9/distutils/text_file.py +0 -286
  196. package/lib/python3.9/distutils/unixccompiler.py +0 -330
  197. package/lib/python3.9/distutils/util.py +0 -559
  198. package/lib/python3.9/distutils/version.py +0 -347
  199. package/lib/python3.9/distutils/versionpredicate.py +0 -166
  200. package/lib/python3.9/doctest.py +0 -2793
  201. package/lib/python3.9/email/__init__.py +0 -62
  202. package/lib/python3.9/email/_encoded_words.py +0 -233
  203. package/lib/python3.9/email/_header_value_parser.py +0 -3003
  204. package/lib/python3.9/email/_parseaddr.py +0 -549
  205. package/lib/python3.9/email/_policybase.py +0 -374
  206. package/lib/python3.9/email/architecture.rst +0 -216
  207. package/lib/python3.9/email/base64mime.py +0 -119
  208. package/lib/python3.9/email/charset.py +0 -404
  209. package/lib/python3.9/email/contentmanager.py +0 -250
  210. package/lib/python3.9/email/encoders.py +0 -69
  211. package/lib/python3.9/email/errors.py +0 -110
  212. package/lib/python3.9/email/feedparser.py +0 -536
  213. package/lib/python3.9/email/generator.py +0 -508
  214. package/lib/python3.9/email/header.py +0 -578
  215. package/lib/python3.9/email/headerregistry.py +0 -601
  216. package/lib/python3.9/email/iterators.py +0 -71
  217. package/lib/python3.9/email/message.py +0 -1173
  218. package/lib/python3.9/email/mime/__init__.py +0 -0
  219. package/lib/python3.9/email/mime/application.py +0 -37
  220. package/lib/python3.9/email/mime/audio.py +0 -74
  221. package/lib/python3.9/email/mime/base.py +0 -30
  222. package/lib/python3.9/email/mime/image.py +0 -47
  223. package/lib/python3.9/email/mime/message.py +0 -34
  224. package/lib/python3.9/email/mime/multipart.py +0 -48
  225. package/lib/python3.9/email/mime/nonmultipart.py +0 -22
  226. package/lib/python3.9/email/mime/text.py +0 -42
  227. package/lib/python3.9/email/parser.py +0 -131
  228. package/lib/python3.9/email/policy.py +0 -224
  229. package/lib/python3.9/email/quoprimime.py +0 -299
  230. package/lib/python3.9/email/utils.py +0 -368
  231. package/lib/python3.9/encodings/__init__.py +0 -169
  232. package/lib/python3.9/encodings/aliases.py +0 -551
  233. package/lib/python3.9/encodings/ascii.py +0 -50
  234. package/lib/python3.9/encodings/base64_codec.py +0 -55
  235. package/lib/python3.9/encodings/big5.py +0 -39
  236. package/lib/python3.9/encodings/big5hkscs.py +0 -39
  237. package/lib/python3.9/encodings/bz2_codec.py +0 -78
  238. package/lib/python3.9/encodings/charmap.py +0 -69
  239. package/lib/python3.9/encodings/cp037.py +0 -307
  240. package/lib/python3.9/encodings/cp1006.py +0 -307
  241. package/lib/python3.9/encodings/cp1026.py +0 -307
  242. package/lib/python3.9/encodings/cp1125.py +0 -698
  243. package/lib/python3.9/encodings/cp1140.py +0 -307
  244. package/lib/python3.9/encodings/cp1250.py +0 -307
  245. package/lib/python3.9/encodings/cp1251.py +0 -307
  246. package/lib/python3.9/encodings/cp1252.py +0 -307
  247. package/lib/python3.9/encodings/cp1253.py +0 -307
  248. package/lib/python3.9/encodings/cp1254.py +0 -307
  249. package/lib/python3.9/encodings/cp1255.py +0 -307
  250. package/lib/python3.9/encodings/cp1256.py +0 -307
  251. package/lib/python3.9/encodings/cp1257.py +0 -307
  252. package/lib/python3.9/encodings/cp1258.py +0 -307
  253. package/lib/python3.9/encodings/cp273.py +0 -307
  254. package/lib/python3.9/encodings/cp424.py +0 -307
  255. package/lib/python3.9/encodings/cp437.py +0 -698
  256. package/lib/python3.9/encodings/cp500.py +0 -307
  257. package/lib/python3.9/encodings/cp720.py +0 -309
  258. package/lib/python3.9/encodings/cp737.py +0 -698
  259. package/lib/python3.9/encodings/cp775.py +0 -697
  260. package/lib/python3.9/encodings/cp850.py +0 -698
  261. package/lib/python3.9/encodings/cp852.py +0 -698
  262. package/lib/python3.9/encodings/cp855.py +0 -698
  263. package/lib/python3.9/encodings/cp856.py +0 -307
  264. package/lib/python3.9/encodings/cp857.py +0 -694
  265. package/lib/python3.9/encodings/cp858.py +0 -698
  266. package/lib/python3.9/encodings/cp860.py +0 -698
  267. package/lib/python3.9/encodings/cp861.py +0 -698
  268. package/lib/python3.9/encodings/cp862.py +0 -698
  269. package/lib/python3.9/encodings/cp863.py +0 -698
  270. package/lib/python3.9/encodings/cp864.py +0 -690
  271. package/lib/python3.9/encodings/cp865.py +0 -698
  272. package/lib/python3.9/encodings/cp866.py +0 -698
  273. package/lib/python3.9/encodings/cp869.py +0 -689
  274. package/lib/python3.9/encodings/cp874.py +0 -307
  275. package/lib/python3.9/encodings/cp875.py +0 -307
  276. package/lib/python3.9/encodings/cp932.py +0 -39
  277. package/lib/python3.9/encodings/cp949.py +0 -39
  278. package/lib/python3.9/encodings/cp950.py +0 -39
  279. package/lib/python3.9/encodings/euc_jis_2004.py +0 -39
  280. package/lib/python3.9/encodings/euc_jisx0213.py +0 -39
  281. package/lib/python3.9/encodings/euc_jp.py +0 -39
  282. package/lib/python3.9/encodings/euc_kr.py +0 -39
  283. package/lib/python3.9/encodings/gb18030.py +0 -39
  284. package/lib/python3.9/encodings/gb2312.py +0 -39
  285. package/lib/python3.9/encodings/gbk.py +0 -39
  286. package/lib/python3.9/encodings/hex_codec.py +0 -55
  287. package/lib/python3.9/encodings/hp_roman8.py +0 -314
  288. package/lib/python3.9/encodings/hz.py +0 -39
  289. package/lib/python3.9/encodings/idna.py +0 -309
  290. package/lib/python3.9/encodings/iso2022_jp.py +0 -39
  291. package/lib/python3.9/encodings/iso2022_jp_1.py +0 -39
  292. package/lib/python3.9/encodings/iso2022_jp_2.py +0 -39
  293. package/lib/python3.9/encodings/iso2022_jp_2004.py +0 -39
  294. package/lib/python3.9/encodings/iso2022_jp_3.py +0 -39
  295. package/lib/python3.9/encodings/iso2022_jp_ext.py +0 -39
  296. package/lib/python3.9/encodings/iso2022_kr.py +0 -39
  297. package/lib/python3.9/encodings/iso8859_1.py +0 -307
  298. package/lib/python3.9/encodings/iso8859_10.py +0 -307
  299. package/lib/python3.9/encodings/iso8859_11.py +0 -307
  300. package/lib/python3.9/encodings/iso8859_13.py +0 -307
  301. package/lib/python3.9/encodings/iso8859_14.py +0 -307
  302. package/lib/python3.9/encodings/iso8859_15.py +0 -307
  303. package/lib/python3.9/encodings/iso8859_16.py +0 -307
  304. package/lib/python3.9/encodings/iso8859_2.py +0 -307
  305. package/lib/python3.9/encodings/iso8859_3.py +0 -307
  306. package/lib/python3.9/encodings/iso8859_4.py +0 -307
  307. package/lib/python3.9/encodings/iso8859_5.py +0 -307
  308. package/lib/python3.9/encodings/iso8859_6.py +0 -307
  309. package/lib/python3.9/encodings/iso8859_7.py +0 -307
  310. package/lib/python3.9/encodings/iso8859_8.py +0 -307
  311. package/lib/python3.9/encodings/iso8859_9.py +0 -307
  312. package/lib/python3.9/encodings/johab.py +0 -39
  313. package/lib/python3.9/encodings/koi8_r.py +0 -307
  314. package/lib/python3.9/encodings/koi8_t.py +0 -308
  315. package/lib/python3.9/encodings/koi8_u.py +0 -307
  316. package/lib/python3.9/encodings/kz1048.py +0 -307
  317. package/lib/python3.9/encodings/latin_1.py +0 -50
  318. package/lib/python3.9/encodings/mac_arabic.py +0 -698
  319. package/lib/python3.9/encodings/mac_croatian.py +0 -307
  320. package/lib/python3.9/encodings/mac_cyrillic.py +0 -307
  321. package/lib/python3.9/encodings/mac_farsi.py +0 -307
  322. package/lib/python3.9/encodings/mac_greek.py +0 -307
  323. package/lib/python3.9/encodings/mac_iceland.py +0 -307
  324. package/lib/python3.9/encodings/mac_latin2.py +0 -312
  325. package/lib/python3.9/encodings/mac_roman.py +0 -307
  326. package/lib/python3.9/encodings/mac_romanian.py +0 -307
  327. package/lib/python3.9/encodings/mac_turkish.py +0 -307
  328. package/lib/python3.9/encodings/mbcs.py +0 -47
  329. package/lib/python3.9/encodings/oem.py +0 -41
  330. package/lib/python3.9/encodings/palmos.py +0 -308
  331. package/lib/python3.9/encodings/ptcp154.py +0 -312
  332. package/lib/python3.9/encodings/punycode.py +0 -237
  333. package/lib/python3.9/encodings/quopri_codec.py +0 -56
  334. package/lib/python3.9/encodings/raw_unicode_escape.py +0 -45
  335. package/lib/python3.9/encodings/rot_13.py +0 -113
  336. package/lib/python3.9/encodings/shift_jis.py +0 -39
  337. package/lib/python3.9/encodings/shift_jis_2004.py +0 -39
  338. package/lib/python3.9/encodings/shift_jisx0213.py +0 -39
  339. package/lib/python3.9/encodings/tis_620.py +0 -307
  340. package/lib/python3.9/encodings/undefined.py +0 -49
  341. package/lib/python3.9/encodings/unicode_escape.py +0 -45
  342. package/lib/python3.9/encodings/utf_16.py +0 -155
  343. package/lib/python3.9/encodings/utf_16_be.py +0 -42
  344. package/lib/python3.9/encodings/utf_16_le.py +0 -42
  345. package/lib/python3.9/encodings/utf_32.py +0 -150
  346. package/lib/python3.9/encodings/utf_32_be.py +0 -37
  347. package/lib/python3.9/encodings/utf_32_le.py +0 -37
  348. package/lib/python3.9/encodings/utf_7.py +0 -38
  349. package/lib/python3.9/encodings/utf_8.py +0 -42
  350. package/lib/python3.9/encodings/utf_8_sig.py +0 -130
  351. package/lib/python3.9/encodings/uu_codec.py +0 -103
  352. package/lib/python3.9/encodings/zlib_codec.py +0 -77
  353. package/lib/python3.9/enum.py +0 -913
  354. package/lib/python3.9/filecmp.py +0 -309
  355. package/lib/python3.9/fileinput.py +0 -432
  356. package/lib/python3.9/fnmatch.py +0 -183
  357. package/lib/python3.9/formatter.py +0 -452
  358. package/lib/python3.9/fractions.py +0 -641
  359. package/lib/python3.9/ftplib.py +0 -974
  360. package/lib/python3.9/functools.py +0 -980
  361. package/lib/python3.9/genericpath.py +0 -155
  362. package/lib/python3.9/getopt.py +0 -215
  363. package/lib/python3.9/getpass.py +0 -185
  364. package/lib/python3.9/gettext.py +0 -788
  365. package/lib/python3.9/glob.py +0 -173
  366. package/lib/python3.9/graphlib.py +0 -245
  367. package/lib/python3.9/gzip.py +0 -609
  368. package/lib/python3.9/hashlib.py +0 -262
  369. package/lib/python3.9/heapq.py +0 -601
  370. package/lib/python3.9/hmac.py +0 -203
  371. package/lib/python3.9/html/__init__.py +0 -132
  372. package/lib/python3.9/html/entities.py +0 -2509
  373. package/lib/python3.9/html/parser.py +0 -462
  374. package/lib/python3.9/http/__init__.py +0 -149
  375. package/lib/python3.9/http/client.py +0 -1495
  376. package/lib/python3.9/http/cookiejar.py +0 -2113
  377. package/lib/python3.9/http/cookies.py +0 -612
  378. package/lib/python3.9/http/server.py +0 -1299
  379. package/lib/python3.9/imaplib.py +0 -1650
  380. package/lib/python3.9/imghdr.py +0 -168
  381. package/lib/python3.9/imp.py +0 -345
  382. package/lib/python3.9/importlib/__init__.py +0 -176
  383. package/lib/python3.9/importlib/_bootstrap.py +0 -1189
  384. package/lib/python3.9/importlib/_bootstrap_external.py +0 -1637
  385. package/lib/python3.9/importlib/_common.py +0 -62
  386. package/lib/python3.9/importlib/abc.py +0 -474
  387. package/lib/python3.9/importlib/machinery.py +0 -21
  388. package/lib/python3.9/importlib/metadata.py +0 -586
  389. package/lib/python3.9/importlib/resources.py +0 -215
  390. package/lib/python3.9/importlib/util.py +0 -300
  391. package/lib/python3.9/inspect.py +0 -3180
  392. package/lib/python3.9/io.py +0 -99
  393. package/lib/python3.9/ipaddress.py +0 -2280
  394. package/lib/python3.9/json/__init__.py +0 -359
  395. package/lib/python3.9/json/decoder.py +0 -356
  396. package/lib/python3.9/json/encoder.py +0 -442
  397. package/lib/python3.9/json/scanner.py +0 -73
  398. package/lib/python3.9/json/tool.py +0 -78
  399. package/lib/python3.9/keyword.py +0 -62
  400. package/lib/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so +0 -0
  401. package/lib/python3.9/lib-dynload/_bisect.cpython-39-x86_64-linux-gnu.so +0 -0
  402. package/lib/python3.9/lib-dynload/_blake2.cpython-39-x86_64-linux-gnu.so +0 -0
  403. package/lib/python3.9/lib-dynload/_bz2.cpython-39-x86_64-linux-gnu.so +0 -0
  404. package/lib/python3.9/lib-dynload/_codecs_cn.cpython-39-x86_64-linux-gnu.so +0 -0
  405. package/lib/python3.9/lib-dynload/_codecs_hk.cpython-39-x86_64-linux-gnu.so +0 -0
  406. package/lib/python3.9/lib-dynload/_codecs_iso2022.cpython-39-x86_64-linux-gnu.so +0 -0
  407. package/lib/python3.9/lib-dynload/_codecs_jp.cpython-39-x86_64-linux-gnu.so +0 -0
  408. package/lib/python3.9/lib-dynload/_codecs_kr.cpython-39-x86_64-linux-gnu.so +0 -0
  409. package/lib/python3.9/lib-dynload/_codecs_tw.cpython-39-x86_64-linux-gnu.so +0 -0
  410. package/lib/python3.9/lib-dynload/_contextvars.cpython-39-x86_64-linux-gnu.so +0 -0
  411. package/lib/python3.9/lib-dynload/_crypt.cpython-39-x86_64-linux-gnu.so +0 -0
  412. package/lib/python3.9/lib-dynload/_csv.cpython-39-x86_64-linux-gnu.so +0 -0
  413. package/lib/python3.9/lib-dynload/_ctypes.cpython-39-x86_64-linux-gnu.so +0 -0
  414. package/lib/python3.9/lib-dynload/_ctypes_test.cpython-39-x86_64-linux-gnu.so +0 -0
  415. package/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so +0 -0
  416. package/lib/python3.9/lib-dynload/_curses_panel.cpython-39-x86_64-linux-gnu.so +0 -0
  417. package/lib/python3.9/lib-dynload/_datetime.cpython-39-x86_64-linux-gnu.so +0 -0
  418. package/lib/python3.9/lib-dynload/_decimal.cpython-39-x86_64-linux-gnu.so +0 -0
  419. package/lib/python3.9/lib-dynload/_elementtree.cpython-39-x86_64-linux-gnu.so +0 -0
  420. package/lib/python3.9/lib-dynload/_hashlib.cpython-39-x86_64-linux-gnu.so +0 -0
  421. package/lib/python3.9/lib-dynload/_heapq.cpython-39-x86_64-linux-gnu.so +0 -0
  422. package/lib/python3.9/lib-dynload/_json.cpython-39-x86_64-linux-gnu.so +0 -0
  423. package/lib/python3.9/lib-dynload/_lsprof.cpython-39-x86_64-linux-gnu.so +0 -0
  424. package/lib/python3.9/lib-dynload/_lzma.cpython-39-x86_64-linux-gnu.so +0 -0
  425. package/lib/python3.9/lib-dynload/_md5.cpython-39-x86_64-linux-gnu.so +0 -0
  426. package/lib/python3.9/lib-dynload/_multibytecodec.cpython-39-x86_64-linux-gnu.so +0 -0
  427. package/lib/python3.9/lib-dynload/_multiprocessing.cpython-39-x86_64-linux-gnu.so +0 -0
  428. package/lib/python3.9/lib-dynload/_opcode.cpython-39-x86_64-linux-gnu.so +0 -0
  429. package/lib/python3.9/lib-dynload/_pickle.cpython-39-x86_64-linux-gnu.so +0 -0
  430. package/lib/python3.9/lib-dynload/_posixshmem.cpython-39-x86_64-linux-gnu.so +0 -0
  431. package/lib/python3.9/lib-dynload/_posixsubprocess.cpython-39-x86_64-linux-gnu.so +0 -0
  432. package/lib/python3.9/lib-dynload/_queue.cpython-39-x86_64-linux-gnu.so +0 -0
  433. package/lib/python3.9/lib-dynload/_random.cpython-39-x86_64-linux-gnu.so +0 -0
  434. package/lib/python3.9/lib-dynload/_sha1.cpython-39-x86_64-linux-gnu.so +0 -0
  435. package/lib/python3.9/lib-dynload/_sha256.cpython-39-x86_64-linux-gnu.so +0 -0
  436. package/lib/python3.9/lib-dynload/_sha3.cpython-39-x86_64-linux-gnu.so +0 -0
  437. package/lib/python3.9/lib-dynload/_sha512.cpython-39-x86_64-linux-gnu.so +0 -0
  438. package/lib/python3.9/lib-dynload/_socket.cpython-39-x86_64-linux-gnu.so +0 -0
  439. package/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so +0 -0
  440. package/lib/python3.9/lib-dynload/_ssl.cpython-39-x86_64-linux-gnu.so +0 -0
  441. package/lib/python3.9/lib-dynload/_statistics.cpython-39-x86_64-linux-gnu.so +0 -0
  442. package/lib/python3.9/lib-dynload/_struct.cpython-39-x86_64-linux-gnu.so +0 -0
  443. package/lib/python3.9/lib-dynload/_testbuffer.cpython-39-x86_64-linux-gnu.so +0 -0
  444. package/lib/python3.9/lib-dynload/_testcapi.cpython-39-x86_64-linux-gnu.so +0 -0
  445. package/lib/python3.9/lib-dynload/_testimportmultiple.cpython-39-x86_64-linux-gnu.so +0 -0
  446. package/lib/python3.9/lib-dynload/_testinternalcapi.cpython-39-x86_64-linux-gnu.so +0 -0
  447. package/lib/python3.9/lib-dynload/_testmultiphase.cpython-39-x86_64-linux-gnu.so +0 -0
  448. package/lib/python3.9/lib-dynload/_tkinter.cpython-39-x86_64-linux-gnu.so +0 -0
  449. package/lib/python3.9/lib-dynload/_xxsubinterpreters.cpython-39-x86_64-linux-gnu.so +0 -0
  450. package/lib/python3.9/lib-dynload/_xxtestfuzz.cpython-39-x86_64-linux-gnu.so +0 -0
  451. package/lib/python3.9/lib-dynload/_zoneinfo.cpython-39-x86_64-linux-gnu.so +0 -0
  452. package/lib/python3.9/lib-dynload/array.cpython-39-x86_64-linux-gnu.so +0 -0
  453. package/lib/python3.9/lib-dynload/audioop.cpython-39-x86_64-linux-gnu.so +0 -0
  454. package/lib/python3.9/lib-dynload/binascii.cpython-39-x86_64-linux-gnu.so +0 -0
  455. package/lib/python3.9/lib-dynload/cmath.cpython-39-x86_64-linux-gnu.so +0 -0
  456. package/lib/python3.9/lib-dynload/fcntl.cpython-39-x86_64-linux-gnu.so +0 -0
  457. package/lib/python3.9/lib-dynload/grp.cpython-39-x86_64-linux-gnu.so +0 -0
  458. package/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so +0 -0
  459. package/lib/python3.9/lib-dynload/mmap.cpython-39-x86_64-linux-gnu.so +0 -0
  460. package/lib/python3.9/lib-dynload/nis.cpython-39-x86_64-linux-gnu.so +0 -0
  461. package/lib/python3.9/lib-dynload/ossaudiodev.cpython-39-x86_64-linux-gnu.so +0 -0
  462. package/lib/python3.9/lib-dynload/parser.cpython-39-x86_64-linux-gnu.so +0 -0
  463. package/lib/python3.9/lib-dynload/pyexpat.cpython-39-x86_64-linux-gnu.so +0 -0
  464. package/lib/python3.9/lib-dynload/readline.cpython-39-x86_64-linux-gnu.so +0 -0
  465. package/lib/python3.9/lib-dynload/resource.cpython-39-x86_64-linux-gnu.so +0 -0
  466. package/lib/python3.9/lib-dynload/select.cpython-39-x86_64-linux-gnu.so +0 -0
  467. package/lib/python3.9/lib-dynload/spwd.cpython-39-x86_64-linux-gnu.so +0 -0
  468. package/lib/python3.9/lib-dynload/syslog.cpython-39-x86_64-linux-gnu.so +0 -0
  469. package/lib/python3.9/lib-dynload/termios.cpython-39-x86_64-linux-gnu.so +0 -0
  470. package/lib/python3.9/lib-dynload/unicodedata.cpython-39-x86_64-linux-gnu.so +0 -0
  471. package/lib/python3.9/lib-dynload/xxlimited.cpython-39-x86_64-linux-gnu.so +0 -0
  472. package/lib/python3.9/lib-dynload/zlib.cpython-39-x86_64-linux-gnu.so +0 -0
  473. package/lib/python3.9/linecache.py +0 -177
  474. package/lib/python3.9/locale.py +0 -1755
  475. package/lib/python3.9/logging/__init__.py +0 -2208
  476. package/lib/python3.9/logging/config.py +0 -945
  477. package/lib/python3.9/logging/handlers.py +0 -1543
  478. package/lib/python3.9/lzma.py +0 -347
  479. package/lib/python3.9/mailbox.py +0 -2151
  480. package/lib/python3.9/mailcap.py +0 -276
  481. package/lib/python3.9/mimetypes.py +0 -614
  482. package/lib/python3.9/modulefinder.py +0 -685
  483. package/lib/python3.9/multiprocessing/__init__.py +0 -37
  484. package/lib/python3.9/multiprocessing/connection.py +0 -978
  485. package/lib/python3.9/multiprocessing/context.py +0 -362
  486. package/lib/python3.9/multiprocessing/dummy/__init__.py +0 -126
  487. package/lib/python3.9/multiprocessing/dummy/connection.py +0 -75
  488. package/lib/python3.9/multiprocessing/forkserver.py +0 -348
  489. package/lib/python3.9/multiprocessing/heap.py +0 -337
  490. package/lib/python3.9/multiprocessing/managers.py +0 -1369
  491. package/lib/python3.9/multiprocessing/pool.py +0 -954
  492. package/lib/python3.9/multiprocessing/popen_fork.py +0 -83
  493. package/lib/python3.9/multiprocessing/popen_forkserver.py +0 -74
  494. package/lib/python3.9/multiprocessing/popen_spawn_posix.py +0 -72
  495. package/lib/python3.9/multiprocessing/popen_spawn_win32.py +0 -131
  496. package/lib/python3.9/multiprocessing/process.py +0 -432
  497. package/lib/python3.9/multiprocessing/queues.py +0 -380
  498. package/lib/python3.9/multiprocessing/reduction.py +0 -281
  499. package/lib/python3.9/multiprocessing/resource_sharer.py +0 -154
  500. package/lib/python3.9/multiprocessing/resource_tracker.py +0 -231
  501. package/lib/python3.9/multiprocessing/shared_memory.py +0 -532
  502. package/lib/python3.9/multiprocessing/sharedctypes.py +0 -240
  503. package/lib/python3.9/multiprocessing/spawn.py +0 -297
  504. package/lib/python3.9/multiprocessing/synchronize.py +0 -394
  505. package/lib/python3.9/multiprocessing/util.py +0 -489
  506. package/lib/python3.9/netrc.py +0 -139
  507. package/lib/python3.9/nntplib.py +0 -1090
  508. package/lib/python3.9/ntpath.py +0 -794
  509. package/lib/python3.9/nturl2path.py +0 -73
  510. package/lib/python3.9/numbers.py +0 -389
  511. package/lib/python3.9/opcode.py +0 -217
  512. package/lib/python3.9/operator.py +0 -460
  513. package/lib/python3.9/optparse.py +0 -1681
  514. package/lib/python3.9/os.py +0 -1116
  515. package/lib/python3.9/pathlib.py +0 -1576
  516. package/lib/python3.9/pdb.py +0 -1731
  517. package/lib/python3.9/pickle.py +0 -1817
  518. package/lib/python3.9/pickletools.py +0 -2890
  519. package/lib/python3.9/pipes.py +0 -247
  520. package/lib/python3.9/pkgutil.py +0 -707
  521. package/lib/python3.9/platform.py +0 -1259
  522. package/lib/python3.9/plistlib.py +0 -881
  523. package/lib/python3.9/poplib.py +0 -483
  524. package/lib/python3.9/posixpath.py +0 -525
  525. package/lib/python3.9/pprint.py +0 -638
  526. package/lib/python3.9/profile.py +0 -600
  527. package/lib/python3.9/pstats.py +0 -779
  528. package/lib/python3.9/pty.py +0 -172
  529. package/lib/python3.9/py_compile.py +0 -215
  530. package/lib/python3.9/pyclbr.py +0 -404
  531. package/lib/python3.9/pydoc.py +0 -2855
  532. package/lib/python3.9/pydoc_data/__init__.py +0 -0
  533. package/lib/python3.9/pydoc_data/_pydoc.css +0 -6
  534. package/lib/python3.9/pydoc_data/topics.py +0 -13968
  535. package/lib/python3.9/queue.py +0 -326
  536. package/lib/python3.9/quopri.py +0 -242
  537. package/lib/python3.9/random.py +0 -887
  538. package/lib/python3.9/re.py +0 -384
  539. package/lib/python3.9/reprlib.py +0 -161
  540. package/lib/python3.9/rlcompleter.py +0 -205
  541. package/lib/python3.9/runpy.py +0 -300
  542. package/lib/python3.9/sched.py +0 -167
  543. package/lib/python3.9/secrets.py +0 -72
  544. package/lib/python3.9/selectors.py +0 -619
  545. package/lib/python3.9/shelve.py +0 -243
  546. package/lib/python3.9/shlex.py +0 -350
  547. package/lib/python3.9/shutil.py +0 -1443
  548. package/lib/python3.9/signal.py +0 -85
  549. package/lib/python3.9/site.py +0 -643
  550. package/lib/python3.9/smtpd.py +0 -967
  551. package/lib/python3.9/smtplib.py +0 -1123
  552. package/lib/python3.9/sndhdr.py +0 -257
  553. package/lib/python3.9/socket.py +0 -958
  554. package/lib/python3.9/socketserver.py +0 -817
  555. package/lib/python3.9/sqlite3/__init__.py +0 -23
  556. package/lib/python3.9/sqlite3/dbapi2.py +0 -89
  557. package/lib/python3.9/sqlite3/dump.py +0 -70
  558. package/lib/python3.9/sre_compile.py +0 -784
  559. package/lib/python3.9/sre_constants.py +0 -259
  560. package/lib/python3.9/sre_parse.py +0 -1064
  561. package/lib/python3.9/ssl.py +0 -1489
  562. package/lib/python3.9/stat.py +0 -195
  563. package/lib/python3.9/statistics.py +0 -1120
  564. package/lib/python3.9/string.py +0 -280
  565. package/lib/python3.9/stringprep.py +0 -272
  566. package/lib/python3.9/struct.py +0 -15
  567. package/lib/python3.9/subprocess.py +0 -2074
  568. package/lib/python3.9/sunau.py +0 -526
  569. package/lib/python3.9/symbol.py +0 -122
  570. package/lib/python3.9/symtable.py +0 -243
  571. package/lib/python3.9/sysconfig.py +0 -720
  572. package/lib/python3.9/tabnanny.py +0 -333
  573. package/lib/python3.9/tarfile.py +0 -2576
  574. package/lib/python3.9/telnetlib.py +0 -677
  575. package/lib/python3.9/tempfile.py +0 -832
  576. package/lib/python3.9/textwrap.py +0 -486
  577. package/lib/python3.9/this.py +0 -28
  578. package/lib/python3.9/threading.py +0 -1502
  579. package/lib/python3.9/timeit.py +0 -375
  580. package/lib/python3.9/token.py +0 -136
  581. package/lib/python3.9/tokenize.py +0 -682
  582. package/lib/python3.9/trace.py +0 -740
  583. package/lib/python3.9/traceback.py +0 -623
  584. package/lib/python3.9/tracemalloc.py +0 -560
  585. package/lib/python3.9/tty.py +0 -36
  586. package/lib/python3.9/turtle.py +0 -4140
  587. package/lib/python3.9/types.py +0 -299
  588. package/lib/python3.9/typing.py +0 -2147
  589. package/lib/python3.9/unittest/__init__.py +0 -95
  590. package/lib/python3.9/unittest/__main__.py +0 -18
  591. package/lib/python3.9/unittest/_log.py +0 -69
  592. package/lib/python3.9/unittest/async_case.py +0 -160
  593. package/lib/python3.9/unittest/case.py +0 -1437
  594. package/lib/python3.9/unittest/loader.py +0 -517
  595. package/lib/python3.9/unittest/main.py +0 -275
  596. package/lib/python3.9/unittest/mock.py +0 -2891
  597. package/lib/python3.9/unittest/result.py +0 -216
  598. package/lib/python3.9/unittest/runner.py +0 -221
  599. package/lib/python3.9/unittest/signals.py +0 -71
  600. package/lib/python3.9/unittest/suite.py +0 -361
  601. package/lib/python3.9/unittest/util.py +0 -170
  602. package/lib/python3.9/urllib/__init__.py +0 -0
  603. package/lib/python3.9/urllib/error.py +0 -77
  604. package/lib/python3.9/urllib/parse.py +0 -1179
  605. package/lib/python3.9/urllib/request.py +0 -2765
  606. package/lib/python3.9/urllib/response.py +0 -84
  607. package/lib/python3.9/urllib/robotparser.py +0 -273
  608. package/lib/python3.9/uu.py +0 -206
  609. package/lib/python3.9/uuid.py +0 -728
  610. package/lib/python3.9/venv/__init__.py +0 -504
  611. package/lib/python3.9/venv/__main__.py +0 -10
  612. package/lib/python3.9/venv/scripts/common/Activate.ps1 +0 -241
  613. package/lib/python3.9/venv/scripts/common/activate +0 -66
  614. package/lib/python3.9/venv/scripts/posix/activate.csh +0 -25
  615. package/lib/python3.9/venv/scripts/posix/activate.fish +0 -64
  616. package/lib/python3.9/warnings.py +0 -549
  617. package/lib/python3.9/wave.py +0 -513
  618. package/lib/python3.9/weakref.py +0 -664
  619. package/lib/python3.9/webbrowser.py +0 -713
  620. package/lib/python3.9/wsgiref/__init__.py +0 -23
  621. package/lib/python3.9/wsgiref/handlers.py +0 -571
  622. package/lib/python3.9/wsgiref/headers.py +0 -184
  623. package/lib/python3.9/wsgiref/simple_server.py +0 -165
  624. package/lib/python3.9/wsgiref/util.py +0 -172
  625. package/lib/python3.9/wsgiref/validate.py +0 -441
  626. package/lib/python3.9/xdrlib.py +0 -241
  627. package/lib/python3.9/xml/__init__.py +0 -20
  628. package/lib/python3.9/xml/dom/NodeFilter.py +0 -27
  629. package/lib/python3.9/xml/dom/__init__.py +0 -140
  630. package/lib/python3.9/xml/dom/domreg.py +0 -99
  631. package/lib/python3.9/xml/dom/expatbuilder.py +0 -965
  632. package/lib/python3.9/xml/dom/minicompat.py +0 -109
  633. package/lib/python3.9/xml/dom/minidom.py +0 -2011
  634. package/lib/python3.9/xml/dom/pulldom.py +0 -349
  635. package/lib/python3.9/xml/dom/xmlbuilder.py +0 -387
  636. package/lib/python3.9/xml/etree/ElementInclude.py +0 -185
  637. package/lib/python3.9/xml/etree/ElementPath.py +0 -405
  638. package/lib/python3.9/xml/etree/ElementTree.py +0 -2085
  639. package/lib/python3.9/xml/etree/__init__.py +0 -33
  640. package/lib/python3.9/xml/etree/cElementTree.py +0 -3
  641. package/lib/python3.9/xml/parsers/__init__.py +0 -8
  642. package/lib/python3.9/xml/parsers/expat.py +0 -8
  643. package/lib/python3.9/xml/sax/__init__.py +0 -107
  644. package/lib/python3.9/xml/sax/_exceptions.py +0 -131
  645. package/lib/python3.9/xml/sax/expatreader.py +0 -446
  646. package/lib/python3.9/xml/sax/handler.py +0 -342
  647. package/lib/python3.9/xml/sax/saxutils.py +0 -369
  648. package/lib/python3.9/xml/sax/xmlreader.py +0 -380
  649. package/lib/python3.9/xmlrpc/__init__.py +0 -1
  650. package/lib/python3.9/xmlrpc/client.py +0 -1524
  651. package/lib/python3.9/xmlrpc/server.py +0 -993
  652. package/lib/python3.9/zipapp.py +0 -206
  653. package/lib/python3.9/zipfile.py +0 -2426
  654. package/lib/python3.9/zipimport.py +0 -792
  655. package/lib/python3.9/zoneinfo/__init__.py +0 -31
  656. package/lib/python3.9/zoneinfo/_common.py +0 -165
  657. package/lib/python3.9/zoneinfo/_tzpath.py +0 -175
  658. package/lib/python3.9/zoneinfo/_zoneinfo.py +0 -752
  659. package/runtime.json +0 -1
  660. package/ssl/cacert.pem +0 -3959
@@ -1,1189 +0,0 @@
1
- """Core implementation of import.
2
-
3
- This module is NOT meant to be directly imported! It has been designed such
4
- that it can be bootstrapped into Python as the implementation of import. As
5
- such it requires the injection of specific modules and attributes in order to
6
- work. One should use importlib as the public-facing version of this module.
7
-
8
- """
9
- #
10
- # IMPORTANT: Whenever making changes to this module, be sure to run a top-level
11
- # `make regen-importlib` followed by `make` in order to get the frozen version
12
- # of the module updated. Not doing so will result in the Makefile to fail for
13
- # all others who don't have a ./python around to freeze the module
14
- # in the early stages of compilation.
15
- #
16
-
17
- # See importlib._setup() for what is injected into the global namespace.
18
-
19
- # When editing this code be aware that code executed at import time CANNOT
20
- # reference any injected objects! This includes not only global code but also
21
- # anything specified at the class level.
22
-
23
- # Bootstrap-related code ######################################################
24
-
25
- _bootstrap_external = None
26
-
27
- def _wrap(new, old):
28
- """Simple substitute for functools.update_wrapper."""
29
- for replace in ['__module__', '__name__', '__qualname__', '__doc__']:
30
- if hasattr(old, replace):
31
- setattr(new, replace, getattr(old, replace))
32
- new.__dict__.update(old.__dict__)
33
-
34
-
35
- def _new_module(name):
36
- return type(sys)(name)
37
-
38
-
39
- # Module-level locking ########################################################
40
-
41
- # A dict mapping module names to weakrefs of _ModuleLock instances
42
- # Dictionary protected by the global import lock
43
- _module_locks = {}
44
- # A dict mapping thread ids to _ModuleLock instances
45
- _blocking_on = {}
46
-
47
-
48
- class _DeadlockError(RuntimeError):
49
- pass
50
-
51
-
52
- class _ModuleLock:
53
- """A recursive lock implementation which is able to detect deadlocks
54
- (e.g. thread 1 trying to take locks A then B, and thread 2 trying to
55
- take locks B then A).
56
- """
57
-
58
- def __init__(self, name):
59
- self.lock = _thread.allocate_lock()
60
- self.wakeup = _thread.allocate_lock()
61
- self.name = name
62
- self.owner = None
63
- self.count = 0
64
- self.waiters = 0
65
-
66
- def has_deadlock(self):
67
- # Deadlock avoidance for concurrent circular imports.
68
- me = _thread.get_ident()
69
- tid = self.owner
70
- seen = set()
71
- while True:
72
- lock = _blocking_on.get(tid)
73
- if lock is None:
74
- return False
75
- tid = lock.owner
76
- if tid == me:
77
- return True
78
- if tid in seen:
79
- # bpo 38091: the chain of tid's we encounter here
80
- # eventually leads to a fixpoint or a cycle, but
81
- # does not reach 'me'. This means we would not
82
- # actually deadlock. This can happen if other
83
- # threads are at the beginning of acquire() below.
84
- return False
85
- seen.add(tid)
86
-
87
- def acquire(self):
88
- """
89
- Acquire the module lock. If a potential deadlock is detected,
90
- a _DeadlockError is raised.
91
- Otherwise, the lock is always acquired and True is returned.
92
- """
93
- tid = _thread.get_ident()
94
- _blocking_on[tid] = self
95
- try:
96
- while True:
97
- with self.lock:
98
- if self.count == 0 or self.owner == tid:
99
- self.owner = tid
100
- self.count += 1
101
- return True
102
- if self.has_deadlock():
103
- raise _DeadlockError('deadlock detected by %r' % self)
104
- if self.wakeup.acquire(False):
105
- self.waiters += 1
106
- # Wait for a release() call
107
- self.wakeup.acquire()
108
- self.wakeup.release()
109
- finally:
110
- del _blocking_on[tid]
111
-
112
- def release(self):
113
- tid = _thread.get_ident()
114
- with self.lock:
115
- if self.owner != tid:
116
- raise RuntimeError('cannot release un-acquired lock')
117
- assert self.count > 0
118
- self.count -= 1
119
- if self.count == 0:
120
- self.owner = None
121
- if self.waiters:
122
- self.waiters -= 1
123
- self.wakeup.release()
124
-
125
- def __repr__(self):
126
- return '_ModuleLock({!r}) at {}'.format(self.name, id(self))
127
-
128
-
129
- class _DummyModuleLock:
130
- """A simple _ModuleLock equivalent for Python builds without
131
- multi-threading support."""
132
-
133
- def __init__(self, name):
134
- self.name = name
135
- self.count = 0
136
-
137
- def acquire(self):
138
- self.count += 1
139
- return True
140
-
141
- def release(self):
142
- if self.count == 0:
143
- raise RuntimeError('cannot release un-acquired lock')
144
- self.count -= 1
145
-
146
- def __repr__(self):
147
- return '_DummyModuleLock({!r}) at {}'.format(self.name, id(self))
148
-
149
-
150
- class _ModuleLockManager:
151
-
152
- def __init__(self, name):
153
- self._name = name
154
- self._lock = None
155
-
156
- def __enter__(self):
157
- self._lock = _get_module_lock(self._name)
158
- self._lock.acquire()
159
-
160
- def __exit__(self, *args, **kwargs):
161
- self._lock.release()
162
-
163
-
164
- # The following two functions are for consumption by Python/import.c.
165
-
166
- def _get_module_lock(name):
167
- """Get or create the module lock for a given module name.
168
-
169
- Acquire/release internally the global import lock to protect
170
- _module_locks."""
171
-
172
- _imp.acquire_lock()
173
- try:
174
- try:
175
- lock = _module_locks[name]()
176
- except KeyError:
177
- lock = None
178
-
179
- if lock is None:
180
- if _thread is None:
181
- lock = _DummyModuleLock(name)
182
- else:
183
- lock = _ModuleLock(name)
184
-
185
- def cb(ref, name=name):
186
- _imp.acquire_lock()
187
- try:
188
- # bpo-31070: Check if another thread created a new lock
189
- # after the previous lock was destroyed
190
- # but before the weakref callback was called.
191
- if _module_locks.get(name) is ref:
192
- del _module_locks[name]
193
- finally:
194
- _imp.release_lock()
195
-
196
- _module_locks[name] = _weakref.ref(lock, cb)
197
- finally:
198
- _imp.release_lock()
199
-
200
- return lock
201
-
202
-
203
- def _lock_unlock_module(name):
204
- """Acquires then releases the module lock for a given module name.
205
-
206
- This is used to ensure a module is completely initialized, in the
207
- event it is being imported by another thread.
208
- """
209
- lock = _get_module_lock(name)
210
- try:
211
- lock.acquire()
212
- except _DeadlockError:
213
- # Concurrent circular import, we'll accept a partially initialized
214
- # module object.
215
- pass
216
- else:
217
- lock.release()
218
-
219
- # Frame stripping magic ###############################################
220
- def _call_with_frames_removed(f, *args, **kwds):
221
- """remove_importlib_frames in import.c will always remove sequences
222
- of importlib frames that end with a call to this function
223
-
224
- Use it instead of a normal call in places where including the importlib
225
- frames introduces unwanted noise into the traceback (e.g. when executing
226
- module code)
227
- """
228
- return f(*args, **kwds)
229
-
230
-
231
- def _verbose_message(message, *args, verbosity=1):
232
- """Print the message to stderr if -v/PYTHONVERBOSE is turned on."""
233
- if sys.flags.verbose >= verbosity:
234
- if not message.startswith(('#', 'import ')):
235
- message = '# ' + message
236
- print(message.format(*args), file=sys.stderr)
237
-
238
-
239
- def _requires_builtin(fxn):
240
- """Decorator to verify the named module is built-in."""
241
- def _requires_builtin_wrapper(self, fullname):
242
- if fullname not in sys.builtin_module_names:
243
- raise ImportError('{!r} is not a built-in module'.format(fullname),
244
- name=fullname)
245
- return fxn(self, fullname)
246
- _wrap(_requires_builtin_wrapper, fxn)
247
- return _requires_builtin_wrapper
248
-
249
-
250
- def _requires_frozen(fxn):
251
- """Decorator to verify the named module is frozen."""
252
- def _requires_frozen_wrapper(self, fullname):
253
- if not _imp.is_frozen(fullname):
254
- raise ImportError('{!r} is not a frozen module'.format(fullname),
255
- name=fullname)
256
- return fxn(self, fullname)
257
- _wrap(_requires_frozen_wrapper, fxn)
258
- return _requires_frozen_wrapper
259
-
260
-
261
- # Typically used by loader classes as a method replacement.
262
- def _load_module_shim(self, fullname):
263
- """Load the specified module into sys.modules and return it.
264
-
265
- This method is deprecated. Use loader.exec_module instead.
266
-
267
- """
268
- spec = spec_from_loader(fullname, self)
269
- if fullname in sys.modules:
270
- module = sys.modules[fullname]
271
- _exec(spec, module)
272
- return sys.modules[fullname]
273
- else:
274
- return _load(spec)
275
-
276
- # Module specifications #######################################################
277
-
278
- def _module_repr(module):
279
- # The implementation of ModuleType.__repr__().
280
- loader = getattr(module, '__loader__', None)
281
- if hasattr(loader, 'module_repr'):
282
- # As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader
283
- # drop their implementations for module_repr. we can add a
284
- # deprecation warning here.
285
- try:
286
- return loader.module_repr(module)
287
- except Exception:
288
- pass
289
- try:
290
- spec = module.__spec__
291
- except AttributeError:
292
- pass
293
- else:
294
- if spec is not None:
295
- return _module_repr_from_spec(spec)
296
-
297
- # We could use module.__class__.__name__ instead of 'module' in the
298
- # various repr permutations.
299
- try:
300
- name = module.__name__
301
- except AttributeError:
302
- name = '?'
303
- try:
304
- filename = module.__file__
305
- except AttributeError:
306
- if loader is None:
307
- return '<module {!r}>'.format(name)
308
- else:
309
- return '<module {!r} ({!r})>'.format(name, loader)
310
- else:
311
- return '<module {!r} from {!r}>'.format(name, filename)
312
-
313
-
314
- class ModuleSpec:
315
- """The specification for a module, used for loading.
316
-
317
- A module's spec is the source for information about the module. For
318
- data associated with the module, including source, use the spec's
319
- loader.
320
-
321
- `name` is the absolute name of the module. `loader` is the loader
322
- to use when loading the module. `parent` is the name of the
323
- package the module is in. The parent is derived from the name.
324
-
325
- `is_package` determines if the module is considered a package or
326
- not. On modules this is reflected by the `__path__` attribute.
327
-
328
- `origin` is the specific location used by the loader from which to
329
- load the module, if that information is available. When filename is
330
- set, origin will match.
331
-
332
- `has_location` indicates that a spec's "origin" reflects a location.
333
- When this is True, `__file__` attribute of the module is set.
334
-
335
- `cached` is the location of the cached bytecode file, if any. It
336
- corresponds to the `__cached__` attribute.
337
-
338
- `submodule_search_locations` is the sequence of path entries to
339
- search when importing submodules. If set, is_package should be
340
- True--and False otherwise.
341
-
342
- Packages are simply modules that (may) have submodules. If a spec
343
- has a non-None value in `submodule_search_locations`, the import
344
- system will consider modules loaded from the spec as packages.
345
-
346
- Only finders (see importlib.abc.MetaPathFinder and
347
- importlib.abc.PathEntryFinder) should modify ModuleSpec instances.
348
-
349
- """
350
-
351
- def __init__(self, name, loader, *, origin=None, loader_state=None,
352
- is_package=None):
353
- self.name = name
354
- self.loader = loader
355
- self.origin = origin
356
- self.loader_state = loader_state
357
- self.submodule_search_locations = [] if is_package else None
358
-
359
- # file-location attributes
360
- self._set_fileattr = False
361
- self._cached = None
362
-
363
- def __repr__(self):
364
- args = ['name={!r}'.format(self.name),
365
- 'loader={!r}'.format(self.loader)]
366
- if self.origin is not None:
367
- args.append('origin={!r}'.format(self.origin))
368
- if self.submodule_search_locations is not None:
369
- args.append('submodule_search_locations={}'
370
- .format(self.submodule_search_locations))
371
- return '{}({})'.format(self.__class__.__name__, ', '.join(args))
372
-
373
- def __eq__(self, other):
374
- smsl = self.submodule_search_locations
375
- try:
376
- return (self.name == other.name and
377
- self.loader == other.loader and
378
- self.origin == other.origin and
379
- smsl == other.submodule_search_locations and
380
- self.cached == other.cached and
381
- self.has_location == other.has_location)
382
- except AttributeError:
383
- return NotImplemented
384
-
385
- @property
386
- def cached(self):
387
- if self._cached is None:
388
- if self.origin is not None and self._set_fileattr:
389
- if _bootstrap_external is None:
390
- raise NotImplementedError
391
- self._cached = _bootstrap_external._get_cached(self.origin)
392
- return self._cached
393
-
394
- @cached.setter
395
- def cached(self, cached):
396
- self._cached = cached
397
-
398
- @property
399
- def parent(self):
400
- """The name of the module's parent."""
401
- if self.submodule_search_locations is None:
402
- return self.name.rpartition('.')[0]
403
- else:
404
- return self.name
405
-
406
- @property
407
- def has_location(self):
408
- return self._set_fileattr
409
-
410
- @has_location.setter
411
- def has_location(self, value):
412
- self._set_fileattr = bool(value)
413
-
414
-
415
- def spec_from_loader(name, loader, *, origin=None, is_package=None):
416
- """Return a module spec based on various loader methods."""
417
- if hasattr(loader, 'get_filename'):
418
- if _bootstrap_external is None:
419
- raise NotImplementedError
420
- spec_from_file_location = _bootstrap_external.spec_from_file_location
421
-
422
- if is_package is None:
423
- return spec_from_file_location(name, loader=loader)
424
- search = [] if is_package else None
425
- return spec_from_file_location(name, loader=loader,
426
- submodule_search_locations=search)
427
-
428
- if is_package is None:
429
- if hasattr(loader, 'is_package'):
430
- try:
431
- is_package = loader.is_package(name)
432
- except ImportError:
433
- is_package = None # aka, undefined
434
- else:
435
- # the default
436
- is_package = False
437
-
438
- return ModuleSpec(name, loader, origin=origin, is_package=is_package)
439
-
440
-
441
- def _spec_from_module(module, loader=None, origin=None):
442
- # This function is meant for use in _setup().
443
- try:
444
- spec = module.__spec__
445
- except AttributeError:
446
- pass
447
- else:
448
- if spec is not None:
449
- return spec
450
-
451
- name = module.__name__
452
- if loader is None:
453
- try:
454
- loader = module.__loader__
455
- except AttributeError:
456
- # loader will stay None.
457
- pass
458
- try:
459
- location = module.__file__
460
- except AttributeError:
461
- location = None
462
- if origin is None:
463
- if location is None:
464
- try:
465
- origin = loader._ORIGIN
466
- except AttributeError:
467
- origin = None
468
- else:
469
- origin = location
470
- try:
471
- cached = module.__cached__
472
- except AttributeError:
473
- cached = None
474
- try:
475
- submodule_search_locations = list(module.__path__)
476
- except AttributeError:
477
- submodule_search_locations = None
478
-
479
- spec = ModuleSpec(name, loader, origin=origin)
480
- spec._set_fileattr = False if location is None else True
481
- spec.cached = cached
482
- spec.submodule_search_locations = submodule_search_locations
483
- return spec
484
-
485
-
486
- def _init_module_attrs(spec, module, *, override=False):
487
- # The passed-in module may be not support attribute assignment,
488
- # in which case we simply don't set the attributes.
489
- # __name__
490
- if (override or getattr(module, '__name__', None) is None):
491
- try:
492
- module.__name__ = spec.name
493
- except AttributeError:
494
- pass
495
- # __loader__
496
- if override or getattr(module, '__loader__', None) is None:
497
- loader = spec.loader
498
- if loader is None:
499
- # A backward compatibility hack.
500
- if spec.submodule_search_locations is not None:
501
- if _bootstrap_external is None:
502
- raise NotImplementedError
503
- _NamespaceLoader = _bootstrap_external._NamespaceLoader
504
-
505
- loader = _NamespaceLoader.__new__(_NamespaceLoader)
506
- loader._path = spec.submodule_search_locations
507
- spec.loader = loader
508
- # While the docs say that module.__file__ is not set for
509
- # built-in modules, and the code below will avoid setting it if
510
- # spec.has_location is false, this is incorrect for namespace
511
- # packages. Namespace packages have no location, but their
512
- # __spec__.origin is None, and thus their module.__file__
513
- # should also be None for consistency. While a bit of a hack,
514
- # this is the best place to ensure this consistency.
515
- #
516
- # See # https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module
517
- # and bpo-32305
518
- module.__file__ = None
519
- try:
520
- module.__loader__ = loader
521
- except AttributeError:
522
- pass
523
- # __package__
524
- if override or getattr(module, '__package__', None) is None:
525
- try:
526
- module.__package__ = spec.parent
527
- except AttributeError:
528
- pass
529
- # __spec__
530
- try:
531
- module.__spec__ = spec
532
- except AttributeError:
533
- pass
534
- # __path__
535
- if override or getattr(module, '__path__', None) is None:
536
- if spec.submodule_search_locations is not None:
537
- try:
538
- module.__path__ = spec.submodule_search_locations
539
- except AttributeError:
540
- pass
541
- # __file__/__cached__
542
- if spec.has_location:
543
- if override or getattr(module, '__file__', None) is None:
544
- try:
545
- module.__file__ = spec.origin
546
- except AttributeError:
547
- pass
548
-
549
- if override or getattr(module, '__cached__', None) is None:
550
- if spec.cached is not None:
551
- try:
552
- module.__cached__ = spec.cached
553
- except AttributeError:
554
- pass
555
- return module
556
-
557
-
558
- def module_from_spec(spec):
559
- """Create a module based on the provided spec."""
560
- # Typically loaders will not implement create_module().
561
- module = None
562
- if hasattr(spec.loader, 'create_module'):
563
- # If create_module() returns `None` then it means default
564
- # module creation should be used.
565
- module = spec.loader.create_module(spec)
566
- elif hasattr(spec.loader, 'exec_module'):
567
- raise ImportError('loaders that define exec_module() '
568
- 'must also define create_module()')
569
- if module is None:
570
- module = _new_module(spec.name)
571
- _init_module_attrs(spec, module)
572
- return module
573
-
574
-
575
- def _module_repr_from_spec(spec):
576
- """Return the repr to use for the module."""
577
- # We mostly replicate _module_repr() using the spec attributes.
578
- name = '?' if spec.name is None else spec.name
579
- if spec.origin is None:
580
- if spec.loader is None:
581
- return '<module {!r}>'.format(name)
582
- else:
583
- return '<module {!r} ({!r})>'.format(name, spec.loader)
584
- else:
585
- if spec.has_location:
586
- return '<module {!r} from {!r}>'.format(name, spec.origin)
587
- else:
588
- return '<module {!r} ({})>'.format(spec.name, spec.origin)
589
-
590
-
591
- # Used by importlib.reload() and _load_module_shim().
592
- def _exec(spec, module):
593
- """Execute the spec's specified module in an existing module's namespace."""
594
- name = spec.name
595
- with _ModuleLockManager(name):
596
- if sys.modules.get(name) is not module:
597
- msg = 'module {!r} not in sys.modules'.format(name)
598
- raise ImportError(msg, name=name)
599
- try:
600
- if spec.loader is None:
601
- if spec.submodule_search_locations is None:
602
- raise ImportError('missing loader', name=spec.name)
603
- # Namespace package.
604
- _init_module_attrs(spec, module, override=True)
605
- else:
606
- _init_module_attrs(spec, module, override=True)
607
- if not hasattr(spec.loader, 'exec_module'):
608
- # (issue19713) Once BuiltinImporter and ExtensionFileLoader
609
- # have exec_module() implemented, we can add a deprecation
610
- # warning here.
611
- spec.loader.load_module(name)
612
- else:
613
- spec.loader.exec_module(module)
614
- finally:
615
- # Update the order of insertion into sys.modules for module
616
- # clean-up at shutdown.
617
- module = sys.modules.pop(spec.name)
618
- sys.modules[spec.name] = module
619
- return module
620
-
621
-
622
- def _load_backward_compatible(spec):
623
- # (issue19713) Once BuiltinImporter and ExtensionFileLoader
624
- # have exec_module() implemented, we can add a deprecation
625
- # warning here.
626
- try:
627
- spec.loader.load_module(spec.name)
628
- except:
629
- if spec.name in sys.modules:
630
- module = sys.modules.pop(spec.name)
631
- sys.modules[spec.name] = module
632
- raise
633
- # The module must be in sys.modules at this point!
634
- # Move it to the end of sys.modules.
635
- module = sys.modules.pop(spec.name)
636
- sys.modules[spec.name] = module
637
- if getattr(module, '__loader__', None) is None:
638
- try:
639
- module.__loader__ = spec.loader
640
- except AttributeError:
641
- pass
642
- if getattr(module, '__package__', None) is None:
643
- try:
644
- # Since module.__path__ may not line up with
645
- # spec.submodule_search_paths, we can't necessarily rely
646
- # on spec.parent here.
647
- module.__package__ = module.__name__
648
- if not hasattr(module, '__path__'):
649
- module.__package__ = spec.name.rpartition('.')[0]
650
- except AttributeError:
651
- pass
652
- if getattr(module, '__spec__', None) is None:
653
- try:
654
- module.__spec__ = spec
655
- except AttributeError:
656
- pass
657
- return module
658
-
659
- def _load_unlocked(spec):
660
- # A helper for direct use by the import system.
661
- if spec.loader is not None:
662
- # Not a namespace package.
663
- if not hasattr(spec.loader, 'exec_module'):
664
- return _load_backward_compatible(spec)
665
-
666
- module = module_from_spec(spec)
667
-
668
- # This must be done before putting the module in sys.modules
669
- # (otherwise an optimization shortcut in import.c becomes
670
- # wrong).
671
- spec._initializing = True
672
- try:
673
- sys.modules[spec.name] = module
674
- try:
675
- if spec.loader is None:
676
- if spec.submodule_search_locations is None:
677
- raise ImportError('missing loader', name=spec.name)
678
- # A namespace package so do nothing.
679
- else:
680
- spec.loader.exec_module(module)
681
- except:
682
- try:
683
- del sys.modules[spec.name]
684
- except KeyError:
685
- pass
686
- raise
687
- # Move the module to the end of sys.modules.
688
- # We don't ensure that the import-related module attributes get
689
- # set in the sys.modules replacement case. Such modules are on
690
- # their own.
691
- module = sys.modules.pop(spec.name)
692
- sys.modules[spec.name] = module
693
- _verbose_message('import {!r} # {!r}', spec.name, spec.loader)
694
- finally:
695
- spec._initializing = False
696
-
697
- return module
698
-
699
- # A method used during testing of _load_unlocked() and by
700
- # _load_module_shim().
701
- def _load(spec):
702
- """Return a new module object, loaded by the spec's loader.
703
-
704
- The module is not added to its parent.
705
-
706
- If a module is already in sys.modules, that existing module gets
707
- clobbered.
708
-
709
- """
710
- with _ModuleLockManager(spec.name):
711
- return _load_unlocked(spec)
712
-
713
-
714
- # Loaders #####################################################################
715
-
716
- class BuiltinImporter:
717
-
718
- """Meta path import for built-in modules.
719
-
720
- All methods are either class or static methods to avoid the need to
721
- instantiate the class.
722
-
723
- """
724
-
725
- _ORIGIN = "built-in"
726
-
727
- @staticmethod
728
- def module_repr(module):
729
- """Return repr for the module.
730
-
731
- The method is deprecated. The import machinery does the job itself.
732
-
733
- """
734
- return f'<module {module.__name__!r} ({BuiltinImporter._ORIGIN})>'
735
-
736
- @classmethod
737
- def find_spec(cls, fullname, path=None, target=None):
738
- if path is not None:
739
- return None
740
- if _imp.is_builtin(fullname):
741
- return spec_from_loader(fullname, cls, origin=cls._ORIGIN)
742
- else:
743
- return None
744
-
745
- @classmethod
746
- def find_module(cls, fullname, path=None):
747
- """Find the built-in module.
748
-
749
- If 'path' is ever specified then the search is considered a failure.
750
-
751
- This method is deprecated. Use find_spec() instead.
752
-
753
- """
754
- spec = cls.find_spec(fullname, path)
755
- return spec.loader if spec is not None else None
756
-
757
- @classmethod
758
- def create_module(self, spec):
759
- """Create a built-in module"""
760
- if spec.name not in sys.builtin_module_names:
761
- raise ImportError('{!r} is not a built-in module'.format(spec.name),
762
- name=spec.name)
763
- return _call_with_frames_removed(_imp.create_builtin, spec)
764
-
765
- @classmethod
766
- def exec_module(self, module):
767
- """Exec a built-in module"""
768
- _call_with_frames_removed(_imp.exec_builtin, module)
769
-
770
- @classmethod
771
- @_requires_builtin
772
- def get_code(cls, fullname):
773
- """Return None as built-in modules do not have code objects."""
774
- return None
775
-
776
- @classmethod
777
- @_requires_builtin
778
- def get_source(cls, fullname):
779
- """Return None as built-in modules do not have source code."""
780
- return None
781
-
782
- @classmethod
783
- @_requires_builtin
784
- def is_package(cls, fullname):
785
- """Return False as built-in modules are never packages."""
786
- return False
787
-
788
- load_module = classmethod(_load_module_shim)
789
-
790
-
791
- class FrozenImporter:
792
-
793
- """Meta path import for frozen modules.
794
-
795
- All methods are either class or static methods to avoid the need to
796
- instantiate the class.
797
-
798
- """
799
-
800
- _ORIGIN = "frozen"
801
-
802
- @staticmethod
803
- def module_repr(m):
804
- """Return repr for the module.
805
-
806
- The method is deprecated. The import machinery does the job itself.
807
-
808
- """
809
- return '<module {!r} ({})>'.format(m.__name__, FrozenImporter._ORIGIN)
810
-
811
- @classmethod
812
- def find_spec(cls, fullname, path=None, target=None):
813
- if _imp.is_frozen(fullname):
814
- return spec_from_loader(fullname, cls, origin=cls._ORIGIN)
815
- else:
816
- return None
817
-
818
- @classmethod
819
- def find_module(cls, fullname, path=None):
820
- """Find a frozen module.
821
-
822
- This method is deprecated. Use find_spec() instead.
823
-
824
- """
825
- return cls if _imp.is_frozen(fullname) else None
826
-
827
- @classmethod
828
- def create_module(cls, spec):
829
- """Use default semantics for module creation."""
830
-
831
- @staticmethod
832
- def exec_module(module):
833
- name = module.__spec__.name
834
- if not _imp.is_frozen(name):
835
- raise ImportError('{!r} is not a frozen module'.format(name),
836
- name=name)
837
- code = _call_with_frames_removed(_imp.get_frozen_object, name)
838
- exec(code, module.__dict__)
839
-
840
- @classmethod
841
- def load_module(cls, fullname):
842
- """Load a frozen module.
843
-
844
- This method is deprecated. Use exec_module() instead.
845
-
846
- """
847
- return _load_module_shim(cls, fullname)
848
-
849
- @classmethod
850
- @_requires_frozen
851
- def get_code(cls, fullname):
852
- """Return the code object for the frozen module."""
853
- return _imp.get_frozen_object(fullname)
854
-
855
- @classmethod
856
- @_requires_frozen
857
- def get_source(cls, fullname):
858
- """Return None as frozen modules do not have source code."""
859
- return None
860
-
861
- @classmethod
862
- @_requires_frozen
863
- def is_package(cls, fullname):
864
- """Return True if the frozen module is a package."""
865
- return _imp.is_frozen_package(fullname)
866
-
867
-
868
- # Import itself ###############################################################
869
-
870
- class _ImportLockContext:
871
-
872
- """Context manager for the import lock."""
873
-
874
- def __enter__(self):
875
- """Acquire the import lock."""
876
- _imp.acquire_lock()
877
-
878
- def __exit__(self, exc_type, exc_value, exc_traceback):
879
- """Release the import lock regardless of any raised exceptions."""
880
- _imp.release_lock()
881
-
882
-
883
- def _resolve_name(name, package, level):
884
- """Resolve a relative module name to an absolute one."""
885
- bits = package.rsplit('.', level - 1)
886
- if len(bits) < level:
887
- raise ImportError('attempted relative import beyond top-level package')
888
- base = bits[0]
889
- return '{}.{}'.format(base, name) if name else base
890
-
891
-
892
- def _find_spec_legacy(finder, name, path):
893
- # This would be a good place for a DeprecationWarning if
894
- # we ended up going that route.
895
- loader = finder.find_module(name, path)
896
- if loader is None:
897
- return None
898
- return spec_from_loader(name, loader)
899
-
900
-
901
- def _find_spec(name, path, target=None):
902
- """Find a module's spec."""
903
- meta_path = sys.meta_path
904
- if meta_path is None:
905
- # PyImport_Cleanup() is running or has been called.
906
- raise ImportError("sys.meta_path is None, Python is likely "
907
- "shutting down")
908
-
909
- if not meta_path:
910
- _warnings.warn('sys.meta_path is empty', ImportWarning)
911
-
912
- # We check sys.modules here for the reload case. While a passed-in
913
- # target will usually indicate a reload there is no guarantee, whereas
914
- # sys.modules provides one.
915
- is_reload = name in sys.modules
916
- for finder in meta_path:
917
- with _ImportLockContext():
918
- try:
919
- find_spec = finder.find_spec
920
- except AttributeError:
921
- spec = _find_spec_legacy(finder, name, path)
922
- if spec is None:
923
- continue
924
- else:
925
- spec = find_spec(name, path, target)
926
- if spec is not None:
927
- # The parent import may have already imported this module.
928
- if not is_reload and name in sys.modules:
929
- module = sys.modules[name]
930
- try:
931
- __spec__ = module.__spec__
932
- except AttributeError:
933
- # We use the found spec since that is the one that
934
- # we would have used if the parent module hadn't
935
- # beaten us to the punch.
936
- return spec
937
- else:
938
- if __spec__ is None:
939
- return spec
940
- else:
941
- return __spec__
942
- else:
943
- return spec
944
- else:
945
- return None
946
-
947
-
948
- def _sanity_check(name, package, level):
949
- """Verify arguments are "sane"."""
950
- if not isinstance(name, str):
951
- raise TypeError('module name must be str, not {}'.format(type(name)))
952
- if level < 0:
953
- raise ValueError('level must be >= 0')
954
- if level > 0:
955
- if not isinstance(package, str):
956
- raise TypeError('__package__ not set to a string')
957
- elif not package:
958
- raise ImportError('attempted relative import with no known parent '
959
- 'package')
960
- if not name and level == 0:
961
- raise ValueError('Empty module name')
962
-
963
-
964
- _ERR_MSG_PREFIX = 'No module named '
965
- _ERR_MSG = _ERR_MSG_PREFIX + '{!r}'
966
-
967
- def _find_and_load_unlocked(name, import_):
968
- path = None
969
- parent = name.rpartition('.')[0]
970
- if parent:
971
- if parent not in sys.modules:
972
- _call_with_frames_removed(import_, parent)
973
- # Crazy side-effects!
974
- if name in sys.modules:
975
- return sys.modules[name]
976
- parent_module = sys.modules[parent]
977
- try:
978
- path = parent_module.__path__
979
- except AttributeError:
980
- msg = (_ERR_MSG + '; {!r} is not a package').format(name, parent)
981
- raise ModuleNotFoundError(msg, name=name) from None
982
- spec = _find_spec(name, path)
983
- if spec is None:
984
- raise ModuleNotFoundError(_ERR_MSG.format(name), name=name)
985
- else:
986
- module = _load_unlocked(spec)
987
- if parent:
988
- # Set the module as an attribute on its parent.
989
- parent_module = sys.modules[parent]
990
- child = name.rpartition('.')[2]
991
- try:
992
- setattr(parent_module, child, module)
993
- except AttributeError:
994
- msg = f"Cannot set an attribute on {parent!r} for child module {child!r}"
995
- _warnings.warn(msg, ImportWarning)
996
- return module
997
-
998
-
999
- _NEEDS_LOADING = object()
1000
-
1001
-
1002
- def _find_and_load(name, import_):
1003
- """Find and load the module."""
1004
- with _ModuleLockManager(name):
1005
- module = sys.modules.get(name, _NEEDS_LOADING)
1006
- if module is _NEEDS_LOADING:
1007
- return _find_and_load_unlocked(name, import_)
1008
-
1009
- if module is None:
1010
- message = ('import of {} halted; '
1011
- 'None in sys.modules'.format(name))
1012
- raise ModuleNotFoundError(message, name=name)
1013
-
1014
- _lock_unlock_module(name)
1015
- return module
1016
-
1017
-
1018
- def _gcd_import(name, package=None, level=0):
1019
- """Import and return the module based on its name, the package the call is
1020
- being made from, and the level adjustment.
1021
-
1022
- This function represents the greatest common denominator of functionality
1023
- between import_module and __import__. This includes setting __package__ if
1024
- the loader did not.
1025
-
1026
- """
1027
- _sanity_check(name, package, level)
1028
- if level > 0:
1029
- name = _resolve_name(name, package, level)
1030
- return _find_and_load(name, _gcd_import)
1031
-
1032
-
1033
- def _handle_fromlist(module, fromlist, import_, *, recursive=False):
1034
- """Figure out what __import__ should return.
1035
-
1036
- The import_ parameter is a callable which takes the name of module to
1037
- import. It is required to decouple the function from assuming importlib's
1038
- import implementation is desired.
1039
-
1040
- """
1041
- # The hell that is fromlist ...
1042
- # If a package was imported, try to import stuff from fromlist.
1043
- for x in fromlist:
1044
- if not isinstance(x, str):
1045
- if recursive:
1046
- where = module.__name__ + '.__all__'
1047
- else:
1048
- where = "``from list''"
1049
- raise TypeError(f"Item in {where} must be str, "
1050
- f"not {type(x).__name__}")
1051
- elif x == '*':
1052
- if not recursive and hasattr(module, '__all__'):
1053
- _handle_fromlist(module, module.__all__, import_,
1054
- recursive=True)
1055
- elif not hasattr(module, x):
1056
- from_name = '{}.{}'.format(module.__name__, x)
1057
- try:
1058
- _call_with_frames_removed(import_, from_name)
1059
- except ModuleNotFoundError as exc:
1060
- # Backwards-compatibility dictates we ignore failed
1061
- # imports triggered by fromlist for modules that don't
1062
- # exist.
1063
- if (exc.name == from_name and
1064
- sys.modules.get(from_name, _NEEDS_LOADING) is not None):
1065
- continue
1066
- raise
1067
- return module
1068
-
1069
-
1070
- def _calc___package__(globals):
1071
- """Calculate what __package__ should be.
1072
-
1073
- __package__ is not guaranteed to be defined or could be set to None
1074
- to represent that its proper value is unknown.
1075
-
1076
- """
1077
- package = globals.get('__package__')
1078
- spec = globals.get('__spec__')
1079
- if package is not None:
1080
- if spec is not None and package != spec.parent:
1081
- _warnings.warn("__package__ != __spec__.parent "
1082
- f"({package!r} != {spec.parent!r})",
1083
- ImportWarning, stacklevel=3)
1084
- return package
1085
- elif spec is not None:
1086
- return spec.parent
1087
- else:
1088
- _warnings.warn("can't resolve package from __spec__ or __package__, "
1089
- "falling back on __name__ and __path__",
1090
- ImportWarning, stacklevel=3)
1091
- package = globals['__name__']
1092
- if '__path__' not in globals:
1093
- package = package.rpartition('.')[0]
1094
- return package
1095
-
1096
-
1097
- def __import__(name, globals=None, locals=None, fromlist=(), level=0):
1098
- """Import a module.
1099
-
1100
- The 'globals' argument is used to infer where the import is occurring from
1101
- to handle relative imports. The 'locals' argument is ignored. The
1102
- 'fromlist' argument specifies what should exist as attributes on the module
1103
- being imported (e.g. ``from module import <fromlist>``). The 'level'
1104
- argument represents the package location to import from in a relative
1105
- import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).
1106
-
1107
- """
1108
- if level == 0:
1109
- module = _gcd_import(name)
1110
- else:
1111
- globals_ = globals if globals is not None else {}
1112
- package = _calc___package__(globals_)
1113
- module = _gcd_import(name, package, level)
1114
- if not fromlist:
1115
- # Return up to the first dot in 'name'. This is complicated by the fact
1116
- # that 'name' may be relative.
1117
- if level == 0:
1118
- return _gcd_import(name.partition('.')[0])
1119
- elif not name:
1120
- return module
1121
- else:
1122
- # Figure out where to slice the module's name up to the first dot
1123
- # in 'name'.
1124
- cut_off = len(name) - len(name.partition('.')[0])
1125
- # Slice end needs to be positive to alleviate need to special-case
1126
- # when ``'.' not in name``.
1127
- return sys.modules[module.__name__[:len(module.__name__)-cut_off]]
1128
- elif hasattr(module, '__path__'):
1129
- return _handle_fromlist(module, fromlist, _gcd_import)
1130
- else:
1131
- return module
1132
-
1133
-
1134
- def _builtin_from_name(name):
1135
- spec = BuiltinImporter.find_spec(name)
1136
- if spec is None:
1137
- raise ImportError('no built-in module named ' + name)
1138
- return _load_unlocked(spec)
1139
-
1140
-
1141
- def _setup(sys_module, _imp_module):
1142
- """Setup importlib by importing needed built-in modules and injecting them
1143
- into the global namespace.
1144
-
1145
- As sys is needed for sys.modules access and _imp is needed to load built-in
1146
- modules, those two modules must be explicitly passed in.
1147
-
1148
- """
1149
- global _imp, sys
1150
- _imp = _imp_module
1151
- sys = sys_module
1152
-
1153
- # Set up the spec for existing builtin/frozen modules.
1154
- module_type = type(sys)
1155
- for name, module in sys.modules.items():
1156
- if isinstance(module, module_type):
1157
- if name in sys.builtin_module_names:
1158
- loader = BuiltinImporter
1159
- elif _imp.is_frozen(name):
1160
- loader = FrozenImporter
1161
- else:
1162
- continue
1163
- spec = _spec_from_module(module, loader)
1164
- _init_module_attrs(spec, module)
1165
-
1166
- # Directly load built-in modules needed during bootstrap.
1167
- self_module = sys.modules[__name__]
1168
- for builtin_name in ('_thread', '_warnings', '_weakref'):
1169
- if builtin_name not in sys.modules:
1170
- builtin_module = _builtin_from_name(builtin_name)
1171
- else:
1172
- builtin_module = sys.modules[builtin_name]
1173
- setattr(self_module, builtin_name, builtin_module)
1174
-
1175
-
1176
- def _install(sys_module, _imp_module):
1177
- """Install importers for builtin and frozen modules"""
1178
- _setup(sys_module, _imp_module)
1179
-
1180
- sys.meta_path.append(BuiltinImporter)
1181
- sys.meta_path.append(FrozenImporter)
1182
-
1183
-
1184
- def _install_external_importers():
1185
- """Install importers that require external filesystem access"""
1186
- global _bootstrap_external
1187
- import _frozen_importlib_external
1188
- _bootstrap_external = _frozen_importlib_external
1189
- _frozen_importlib_external._install(sys.modules[__name__])