Nuitka
The Python compiler
Loading...
Searching...
No Matches
HelpersImportHard.c
1// Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
3/* WARNING, this code is GENERATED. Modify the template HelperImportHard.c.j2 instead! */
4
5/* This file is included from another C file, help IDEs to still parse it on its own. */
6#ifdef __IDE_ONLY__
7#include "nuitka/prelude.h"
8#endif
9
10/* C helper for hard import of module "__future__" import. */
11PyObject *IMPORT_HARD___FUTURE__(void) {
12 static PyObject *module_import_hard___future__ = NULL;
13
14 if (module_import_hard___future__ == NULL) {
15 module_import_hard___future__ = PyImport_ImportModule("__future__");
16
17 if (unlikely(module_import_hard___future__ == NULL)) {
18#ifndef __NUITKA_NO_ASSERT__
19 PyErr_PrintEx(0);
20#endif
21 NUITKA_ERROR_EXIT("Unexpected failure of hard import of '__future__'");
22 }
23 }
24
25 return module_import_hard___future__;
26}
27
28/* C helper for hard import of module "_frozen_importlib" import. */
29#if PYTHON_VERSION >= 0x300
30PyObject *IMPORT_HARD__FROZEN_IMPORTLIB(void) {
31 static PyObject *module_import_hard__frozen_importlib = NULL;
32
33 if (module_import_hard__frozen_importlib == NULL) {
34 module_import_hard__frozen_importlib = PyImport_ImportModule("_frozen_importlib");
35
36 if (unlikely(module_import_hard__frozen_importlib == NULL)) {
37#ifndef __NUITKA_NO_ASSERT__
38 PyErr_PrintEx(0);
39#endif
40 NUITKA_ERROR_EXIT("Unexpected failure of hard import of '_frozen_importlib'");
41 }
42 }
43
44 return module_import_hard__frozen_importlib;
45}
46#endif
47
48/* C helper for hard import of module "_frozen_importlib_external" import. */
49#if PYTHON_VERSION >= 0x350
50PyObject *IMPORT_HARD__FROZEN_IMPORTLIB_EXTERNAL(void) {
51 static PyObject *module_import_hard__frozen_importlib_external = NULL;
52
53 if (module_import_hard__frozen_importlib_external == NULL) {
54 module_import_hard__frozen_importlib_external = PyImport_ImportModule("_frozen_importlib_external");
55
56 if (unlikely(module_import_hard__frozen_importlib_external == NULL)) {
57#ifndef __NUITKA_NO_ASSERT__
58 PyErr_PrintEx(0);
59#endif
60 NUITKA_ERROR_EXIT("Unexpected failure of hard import of '_frozen_importlib_external'");
61 }
62 }
63
64 return module_import_hard__frozen_importlib_external;
65}
66#endif
67
68/* C helper for hard import of module "_io" import. */
69PyObject *IMPORT_HARD__IO(void) {
70 static PyObject *module_import_hard__io = NULL;
71
72 if (module_import_hard__io == NULL) {
73 module_import_hard__io = PyImport_ImportModule("_io");
74
75 if (unlikely(module_import_hard__io == NULL)) {
76#ifndef __NUITKA_NO_ASSERT__
77 PyErr_PrintEx(0);
78#endif
79 NUITKA_ERROR_EXIT("Unexpected failure of hard import of '_io'");
80 }
81 }
82
83 return module_import_hard__io;
84}
85
86/* C helper for hard import of module "builtins" import. */
87PyObject *IMPORT_HARD_BUILTINS(void) {
88 static PyObject *module_import_hard_builtins = NULL;
89
90 if (module_import_hard_builtins == NULL) {
91 module_import_hard_builtins = PyImport_ImportModule("builtins");
92
93 if (unlikely(module_import_hard_builtins == NULL)) {
94#ifndef __NUITKA_NO_ASSERT__
95 PyErr_PrintEx(0);
96#endif
97 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'builtins'");
98 }
99 }
100
101 return module_import_hard_builtins;
102}
103
104/* C helper for hard import of module "ctypes" import. */
105PyObject *IMPORT_HARD_CTYPES(void) {
106 static PyObject *module_import_hard_ctypes = NULL;
107
108 if (module_import_hard_ctypes == NULL) {
109 module_import_hard_ctypes = PyImport_ImportModule("ctypes");
110
111 if (unlikely(module_import_hard_ctypes == NULL)) {
112#ifndef __NUITKA_NO_ASSERT__
113 PyErr_PrintEx(0);
114#endif
115 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes'");
116 }
117 }
118
119 return module_import_hard_ctypes;
120}
121
122/* C helper for hard import of module "ctypes.macholib" import. */
123PyObject *IMPORT_HARD_CTYPES__MACHOLIB(void) {
124 static PyObject *module_import_hard_ctypes__macholib = NULL;
125
126 if (module_import_hard_ctypes__macholib == NULL) {
127 module_import_hard_ctypes__macholib = PyImport_ImportModule("ctypes.macholib");
128
129 if (unlikely(module_import_hard_ctypes__macholib == NULL)) {
130#ifndef __NUITKA_NO_ASSERT__
131 PyErr_PrintEx(0);
132#endif
133 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes.macholib'");
134 }
135 }
136
137 return module_import_hard_ctypes__macholib;
138}
139
140/* C helper for hard import of module "ctypes.wintypes" import. */
141#if defined(_WIN32)
142PyObject *IMPORT_HARD_CTYPES__WINTYPES(void) {
143 static PyObject *module_import_hard_ctypes__wintypes = NULL;
144
145 if (module_import_hard_ctypes__wintypes == NULL) {
146 module_import_hard_ctypes__wintypes = PyImport_ImportModule("ctypes.wintypes");
147
148 if (unlikely(module_import_hard_ctypes__wintypes == NULL)) {
149#ifndef __NUITKA_NO_ASSERT__
150 PyErr_PrintEx(0);
151#endif
152 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes.wintypes'");
153 }
154 }
155
156 return module_import_hard_ctypes__wintypes;
157}
158#endif
159
160/* C helper for hard import of module "functools" import. */
161PyObject *IMPORT_HARD_FUNCTOOLS(void) {
162 static PyObject *module_import_hard_functools = NULL;
163
164 if (module_import_hard_functools == NULL) {
165 module_import_hard_functools = PyImport_ImportModule("functools");
166
167 if (unlikely(module_import_hard_functools == NULL)) {
168#ifndef __NUITKA_NO_ASSERT__
169 PyErr_PrintEx(0);
170#endif
171 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'functools'");
172 }
173 }
174
175 return module_import_hard_functools;
176}
177
178/* C helper for hard import of module "importlib" import. */
179PyObject *IMPORT_HARD_IMPORTLIB(void) {
180 static PyObject *module_import_hard_importlib = NULL;
181
182 if (module_import_hard_importlib == NULL) {
183 module_import_hard_importlib = PyImport_ImportModule("importlib");
184
185 if (unlikely(module_import_hard_importlib == NULL)) {
186#ifndef __NUITKA_NO_ASSERT__
187 PyErr_PrintEx(0);
188#endif
189 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'importlib'");
190 }
191 }
192
193 return module_import_hard_importlib;
194}
195
196/* C helper for hard import of module "importlib.metadata" import. */
197#if PYTHON_VERSION >= 0x380
198PyObject *IMPORT_HARD_IMPORTLIB__METADATA(void) {
199 static PyObject *module_import_hard_importlib__metadata = NULL;
200
201 if (module_import_hard_importlib__metadata == NULL) {
202 module_import_hard_importlib__metadata = PyImport_ImportModule("importlib.metadata");
203
204 if (unlikely(module_import_hard_importlib__metadata == NULL)) {
205#ifndef __NUITKA_NO_ASSERT__
206 PyErr_PrintEx(0);
207#endif
208 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'importlib.metadata'");
209 }
210 }
211
212 return module_import_hard_importlib__metadata;
213}
214#endif
215
216/* C helper for hard import of module "importlib.resources" import. */
217#if PYTHON_VERSION >= 0x370
218PyObject *IMPORT_HARD_IMPORTLIB__RESOURCES(void) {
219 static PyObject *module_import_hard_importlib__resources = NULL;
220
221 if (module_import_hard_importlib__resources == NULL) {
222 module_import_hard_importlib__resources = PyImport_ImportModule("importlib.resources");
223
224 if (unlikely(module_import_hard_importlib__resources == NULL)) {
225#ifndef __NUITKA_NO_ASSERT__
226 PyErr_PrintEx(0);
227#endif
228 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'importlib.resources'");
229 }
230 }
231
232 return module_import_hard_importlib__resources;
233}
234#endif
235
236/* C helper for hard import of module "importlib_metadata" import. */
237PyObject *IMPORT_HARD_IMPORTLIB_METADATA(void) {
238 static PyObject *module_import_hard_importlib_metadata = NULL;
239
240 if (module_import_hard_importlib_metadata == NULL) {
241 module_import_hard_importlib_metadata = PyImport_ImportModule("importlib_metadata");
242
243 if (unlikely(module_import_hard_importlib_metadata == NULL)) {
244 return NULL;
245 }
246 }
247
248 return module_import_hard_importlib_metadata;
249}
250
251/* C helper for hard import of module "importlib_resources" import. */
252PyObject *IMPORT_HARD_IMPORTLIB_RESOURCES(void) {
253 static PyObject *module_import_hard_importlib_resources = NULL;
254
255 if (module_import_hard_importlib_resources == NULL) {
256 module_import_hard_importlib_resources = PyImport_ImportModule("importlib_resources");
257
258 if (unlikely(module_import_hard_importlib_resources == NULL)) {
259 return NULL;
260 }
261 }
262
263 return module_import_hard_importlib_resources;
264}
265
266/* C helper for hard import of module "io" import. */
267PyObject *IMPORT_HARD_IO(void) {
268 static PyObject *module_import_hard_io = NULL;
269
270 if (module_import_hard_io == NULL) {
271 module_import_hard_io = PyImport_ImportModule("io");
272
273 if (unlikely(module_import_hard_io == NULL)) {
274#ifndef __NUITKA_NO_ASSERT__
275 PyErr_PrintEx(0);
276#endif
277 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'io'");
278 }
279 }
280
281 return module_import_hard_io;
282}
283
284/* C helper for hard import of module "ntpath" import. */
285PyObject *IMPORT_HARD_NTPATH(void) {
286 static PyObject *module_import_hard_ntpath = NULL;
287
288 if (module_import_hard_ntpath == NULL) {
289 module_import_hard_ntpath = PyImport_ImportModule("ntpath");
290
291 if (unlikely(module_import_hard_ntpath == NULL)) {
292#ifndef __NUITKA_NO_ASSERT__
293 PyErr_PrintEx(0);
294#endif
295 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ntpath'");
296 }
297 }
298
299 return module_import_hard_ntpath;
300}
301
302/* C helper for hard import of module "os" import. */
303PyObject *IMPORT_HARD_OS(void) {
304 static PyObject *module_import_hard_os = NULL;
305
306 if (module_import_hard_os == NULL) {
307 module_import_hard_os = PyImport_ImportModule("os");
308
309 if (unlikely(module_import_hard_os == NULL)) {
310#ifndef __NUITKA_NO_ASSERT__
311 PyErr_PrintEx(0);
312#endif
313 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'os'");
314 }
315 }
316
317 return module_import_hard_os;
318}
319
320/* C helper for hard import of module "pkg_resources" import. */
321PyObject *IMPORT_HARD_PKG_RESOURCES(void) {
322 static PyObject *module_import_hard_pkg_resources = NULL;
323
324 if (module_import_hard_pkg_resources == NULL) {
325 module_import_hard_pkg_resources = PyImport_ImportModule("pkg_resources");
326
327 if (unlikely(module_import_hard_pkg_resources == NULL)) {
328 return NULL;
329 }
330 }
331
332 return module_import_hard_pkg_resources;
333}
334
335/* C helper for hard import of module "pkgutil" import. */
336PyObject *IMPORT_HARD_PKGUTIL(void) {
337 static PyObject *module_import_hard_pkgutil = NULL;
338
339 if (module_import_hard_pkgutil == NULL) {
340 module_import_hard_pkgutil = PyImport_ImportModule("pkgutil");
341
342 if (unlikely(module_import_hard_pkgutil == NULL)) {
343#ifndef __NUITKA_NO_ASSERT__
344 PyErr_PrintEx(0);
345#endif
346 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'pkgutil'");
347 }
348 }
349
350 return module_import_hard_pkgutil;
351}
352
353/* C helper for hard import of module "posixpath" import. */
354PyObject *IMPORT_HARD_POSIXPATH(void) {
355 static PyObject *module_import_hard_posixpath = NULL;
356
357 if (module_import_hard_posixpath == NULL) {
358 module_import_hard_posixpath = PyImport_ImportModule("posixpath");
359
360 if (unlikely(module_import_hard_posixpath == NULL)) {
361#ifndef __NUITKA_NO_ASSERT__
362 PyErr_PrintEx(0);
363#endif
364 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'posixpath'");
365 }
366 }
367
368 return module_import_hard_posixpath;
369}
370
371/* C helper for hard import of module "site" import. */
372PyObject *IMPORT_HARD_SITE(void) {
373 static PyObject *module_import_hard_site = NULL;
374
375 if (module_import_hard_site == NULL) {
376 module_import_hard_site = PyImport_ImportModule("site");
377
378 if (unlikely(module_import_hard_site == NULL)) {
379 return NULL;
380 }
381 }
382
383 return module_import_hard_site;
384}
385
386/* C helper for hard import of module "sys" import. */
387PyObject *IMPORT_HARD_SYS(void) {
388 static PyObject *module_import_hard_sys = NULL;
389
390 if (module_import_hard_sys == NULL) {
391 module_import_hard_sys = PyImport_ImportModule("sys");
392
393 if (unlikely(module_import_hard_sys == NULL)) {
394#ifndef __NUITKA_NO_ASSERT__
395 PyErr_PrintEx(0);
396#endif
397 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'sys'");
398 }
399 }
400
401 return module_import_hard_sys;
402}
403
404/* C helper for hard import of module "sysconfig" import. */
405PyObject *IMPORT_HARD_SYSCONFIG(void) {
406 static PyObject *module_import_hard_sysconfig = NULL;
407
408 if (module_import_hard_sysconfig == NULL) {
409 module_import_hard_sysconfig = PyImport_ImportModule("sysconfig");
410
411 if (unlikely(module_import_hard_sysconfig == NULL)) {
412#ifndef __NUITKA_NO_ASSERT__
413 PyErr_PrintEx(0);
414#endif
415 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'sysconfig'");
416 }
417 }
418
419 return module_import_hard_sysconfig;
420}
421
422/* C helper for hard import of module "tensorflow" import. */
423PyObject *IMPORT_HARD_TENSORFLOW(void) {
424 static PyObject *module_import_hard_tensorflow = NULL;
425
426 if (module_import_hard_tensorflow == NULL) {
427 module_import_hard_tensorflow = PyImport_ImportModule("tensorflow");
428
429 if (unlikely(module_import_hard_tensorflow == NULL)) {
430 return NULL;
431 }
432 }
433
434 return module_import_hard_tensorflow;
435}
436
437/* C helper for hard import of module "types" import. */
438PyObject *IMPORT_HARD_TYPES(void) {
439 static PyObject *module_import_hard_types = NULL;
440
441 if (module_import_hard_types == NULL) {
442 module_import_hard_types = PyImport_ImportModule("types");
443
444 if (unlikely(module_import_hard_types == NULL)) {
445#ifndef __NUITKA_NO_ASSERT__
446 PyErr_PrintEx(0);
447#endif
448 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'types'");
449 }
450 }
451
452 return module_import_hard_types;
453}
454
455/* C helper for hard import of module "typing" import. */
456#if PYTHON_VERSION >= 0x350
457PyObject *IMPORT_HARD_TYPING(void) {
458 static PyObject *module_import_hard_typing = NULL;
459
460 if (module_import_hard_typing == NULL) {
461 module_import_hard_typing = PyImport_ImportModule("typing");
462
463 if (unlikely(module_import_hard_typing == NULL)) {
464#ifndef __NUITKA_NO_ASSERT__
465 PyErr_PrintEx(0);
466#endif
467 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'typing'");
468 }
469 }
470
471 return module_import_hard_typing;
472}
473#endif
474
475/* C helper for hard import of module "unittest" import. */
476PyObject *IMPORT_HARD_UNITTEST(void) {
477 static PyObject *module_import_hard_unittest = NULL;
478
479 if (module_import_hard_unittest == NULL) {
480 module_import_hard_unittest = PyImport_ImportModule("unittest");
481
482 if (unlikely(module_import_hard_unittest == NULL)) {
483#ifndef __NUITKA_NO_ASSERT__
484 PyErr_PrintEx(0);
485#endif
486 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'unittest'");
487 }
488 }
489
490 return module_import_hard_unittest;
491}
492
493/* C helper for hard import of module "unittest.mock" import. */
494#if PYTHON_VERSION >= 0x300
495PyObject *IMPORT_HARD_UNITTEST__MOCK(void) {
496 static PyObject *module_import_hard_unittest__mock = NULL;
497
498 if (module_import_hard_unittest__mock == NULL) {
499 module_import_hard_unittest__mock = PyImport_ImportModule("unittest.mock");
500
501 if (unlikely(module_import_hard_unittest__mock == NULL)) {
502#ifndef __NUITKA_NO_ASSERT__
503 PyErr_PrintEx(0);
504#endif
505 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'unittest.mock'");
506 }
507 }
508
509 return module_import_hard_unittest__mock;
510}
511#endif
512
513// Part of "Nuitka", an optimizing Python compiler that is compatible and
514// integrates with CPython, but also works on its own.
515//
516// Licensed under the Apache License, Version 2.0 (the "License");
517// you may not use this file except in compliance with the License.
518// You may obtain a copy of the License at
519//
520// http://www.apache.org/licenses/LICENSE-2.0
521//
522// Unless required by applicable law or agreed to in writing, software
523// distributed under the License is distributed on an "AS IS" BASIS,
524// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
525// See the License for the specific language governing permissions and
526// limitations under the License.