Nuitka
The Python compiler
Loading...
Searching...
No Matches
HelpersImportHard.c
1// Copyright 2026, 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._aix" import. */
123PyObject *IMPORT_HARD_CTYPES___AIX(void) {
124 static PyObject *module_import_hard_ctypes___aix = NULL;
125
126 if (module_import_hard_ctypes___aix == NULL) {
127 module_import_hard_ctypes___aix = PyImport_ImportModule("ctypes._aix");
128
129 if (unlikely(module_import_hard_ctypes___aix == NULL)) {
130#ifndef __NUITKA_NO_ASSERT__
131 PyErr_PrintEx(0);
132#endif
133 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes._aix'");
134 }
135 }
136
137 return module_import_hard_ctypes___aix;
138}
139
140/* C helper for hard import of module "ctypes._endian" import. */
141PyObject *IMPORT_HARD_CTYPES___ENDIAN(void) {
142 static PyObject *module_import_hard_ctypes___endian = NULL;
143
144 if (module_import_hard_ctypes___endian == NULL) {
145 module_import_hard_ctypes___endian = PyImport_ImportModule("ctypes._endian");
146
147 if (unlikely(module_import_hard_ctypes___endian == NULL)) {
148#ifndef __NUITKA_NO_ASSERT__
149 PyErr_PrintEx(0);
150#endif
151 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes._endian'");
152 }
153 }
154
155 return module_import_hard_ctypes___endian;
156}
157
158/* C helper for hard import of module "ctypes.macholib" import. */
159PyObject *IMPORT_HARD_CTYPES__MACHOLIB(void) {
160 static PyObject *module_import_hard_ctypes__macholib = NULL;
161
162 if (module_import_hard_ctypes__macholib == NULL) {
163 module_import_hard_ctypes__macholib = PyImport_ImportModule("ctypes.macholib");
164
165 if (unlikely(module_import_hard_ctypes__macholib == NULL)) {
166#ifndef __NUITKA_NO_ASSERT__
167 PyErr_PrintEx(0);
168#endif
169 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes.macholib'");
170 }
171 }
172
173 return module_import_hard_ctypes__macholib;
174}
175
176/* C helper for hard import of module "ctypes.util" import. */
177PyObject *IMPORT_HARD_CTYPES__UTIL(void) {
178 static PyObject *module_import_hard_ctypes__util = NULL;
179
180 if (module_import_hard_ctypes__util == NULL) {
181 module_import_hard_ctypes__util = PyImport_ImportModule("ctypes.util");
182
183 if (unlikely(module_import_hard_ctypes__util == NULL)) {
184#ifndef __NUITKA_NO_ASSERT__
185 PyErr_PrintEx(0);
186#endif
187 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes.util'");
188 }
189 }
190
191 return module_import_hard_ctypes__util;
192}
193
194/* C helper for hard import of module "ctypes.wintypes" import. */
195#if defined(_WIN32)
196PyObject *IMPORT_HARD_CTYPES__WINTYPES(void) {
197 static PyObject *module_import_hard_ctypes__wintypes = NULL;
198
199 if (module_import_hard_ctypes__wintypes == NULL) {
200 module_import_hard_ctypes__wintypes = PyImport_ImportModule("ctypes.wintypes");
201
202 if (unlikely(module_import_hard_ctypes__wintypes == NULL)) {
203#ifndef __NUITKA_NO_ASSERT__
204 PyErr_PrintEx(0);
205#endif
206 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ctypes.wintypes'");
207 }
208 }
209
210 return module_import_hard_ctypes__wintypes;
211}
212#endif
213
214/* C helper for hard import of module "functools" import. */
215PyObject *IMPORT_HARD_FUNCTOOLS(void) {
216 static PyObject *module_import_hard_functools = NULL;
217
218 if (module_import_hard_functools == NULL) {
219 module_import_hard_functools = PyImport_ImportModule("functools");
220
221 if (unlikely(module_import_hard_functools == NULL)) {
222#ifndef __NUITKA_NO_ASSERT__
223 PyErr_PrintEx(0);
224#endif
225 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'functools'");
226 }
227 }
228
229 return module_import_hard_functools;
230}
231
232/* C helper for hard import of module "importlib" import. */
233PyObject *IMPORT_HARD_IMPORTLIB(void) {
234 static PyObject *module_import_hard_importlib = NULL;
235
236 if (module_import_hard_importlib == NULL) {
237 module_import_hard_importlib = PyImport_ImportModule("importlib");
238
239 if (unlikely(module_import_hard_importlib == NULL)) {
240#ifndef __NUITKA_NO_ASSERT__
241 PyErr_PrintEx(0);
242#endif
243 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'importlib'");
244 }
245 }
246
247 return module_import_hard_importlib;
248}
249
250/* C helper for hard import of module "importlib.metadata" import. */
251#if PYTHON_VERSION >= 0x380
252PyObject *IMPORT_HARD_IMPORTLIB__METADATA(void) {
253 static PyObject *module_import_hard_importlib__metadata = NULL;
254
255 if (module_import_hard_importlib__metadata == NULL) {
256 module_import_hard_importlib__metadata = PyImport_ImportModule("importlib.metadata");
257
258 if (unlikely(module_import_hard_importlib__metadata == NULL)) {
259#ifndef __NUITKA_NO_ASSERT__
260 PyErr_PrintEx(0);
261#endif
262 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'importlib.metadata'");
263 }
264 }
265
266 return module_import_hard_importlib__metadata;
267}
268#endif
269
270/* C helper for hard import of module "importlib.resources" import. */
271#if PYTHON_VERSION >= 0x370
272PyObject *IMPORT_HARD_IMPORTLIB__RESOURCES(void) {
273 static PyObject *module_import_hard_importlib__resources = NULL;
274
275 if (module_import_hard_importlib__resources == NULL) {
276 module_import_hard_importlib__resources = PyImport_ImportModule("importlib.resources");
277
278 if (unlikely(module_import_hard_importlib__resources == NULL)) {
279#ifndef __NUITKA_NO_ASSERT__
280 PyErr_PrintEx(0);
281#endif
282 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'importlib.resources'");
283 }
284 }
285
286 return module_import_hard_importlib__resources;
287}
288#endif
289
290/* C helper for hard import of module "importlib_metadata" import. */
291PyObject *IMPORT_HARD_IMPORTLIB_METADATA(void) {
292 static PyObject *module_import_hard_importlib_metadata = NULL;
293
294 if (module_import_hard_importlib_metadata == NULL) {
295 module_import_hard_importlib_metadata = PyImport_ImportModule("importlib_metadata");
296
297 if (unlikely(module_import_hard_importlib_metadata == NULL)) {
298 return NULL;
299 }
300 }
301
302 return module_import_hard_importlib_metadata;
303}
304
305/* C helper for hard import of module "importlib_resources" import. */
306PyObject *IMPORT_HARD_IMPORTLIB_RESOURCES(void) {
307 static PyObject *module_import_hard_importlib_resources = NULL;
308
309 if (module_import_hard_importlib_resources == NULL) {
310 module_import_hard_importlib_resources = PyImport_ImportModule("importlib_resources");
311
312 if (unlikely(module_import_hard_importlib_resources == NULL)) {
313 return NULL;
314 }
315 }
316
317 return module_import_hard_importlib_resources;
318}
319
320/* C helper for hard import of module "io" import. */
321PyObject *IMPORT_HARD_IO(void) {
322 static PyObject *module_import_hard_io = NULL;
323
324 if (module_import_hard_io == NULL) {
325 module_import_hard_io = PyImport_ImportModule("io");
326
327 if (unlikely(module_import_hard_io == NULL)) {
328#ifndef __NUITKA_NO_ASSERT__
329 PyErr_PrintEx(0);
330#endif
331 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'io'");
332 }
333 }
334
335 return module_import_hard_io;
336}
337
338/* C helper for hard import of module "ntpath" import. */
339PyObject *IMPORT_HARD_NTPATH(void) {
340 static PyObject *module_import_hard_ntpath = NULL;
341
342 if (module_import_hard_ntpath == NULL) {
343 module_import_hard_ntpath = PyImport_ImportModule("ntpath");
344
345 if (unlikely(module_import_hard_ntpath == NULL)) {
346#ifndef __NUITKA_NO_ASSERT__
347 PyErr_PrintEx(0);
348#endif
349 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'ntpath'");
350 }
351 }
352
353 return module_import_hard_ntpath;
354}
355
356/* C helper for hard import of module "os" import. */
357PyObject *IMPORT_HARD_OS(void) {
358 static PyObject *module_import_hard_os = NULL;
359
360 if (module_import_hard_os == NULL) {
361 module_import_hard_os = PyImport_ImportModule("os");
362
363 if (unlikely(module_import_hard_os == NULL)) {
364#ifndef __NUITKA_NO_ASSERT__
365 PyErr_PrintEx(0);
366#endif
367 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'os'");
368 }
369 }
370
371 return module_import_hard_os;
372}
373
374/* C helper for hard import of module "pathlib" import. */
375#if PYTHON_VERSION >= 0x3d0
376PyObject *IMPORT_HARD_PATHLIB(void) {
377 static PyObject *module_import_hard_pathlib = NULL;
378
379 if (module_import_hard_pathlib == NULL) {
380 module_import_hard_pathlib = PyImport_ImportModule("pathlib");
381
382 if (unlikely(module_import_hard_pathlib == NULL)) {
383#ifndef __NUITKA_NO_ASSERT__
384 PyErr_PrintEx(0);
385#endif
386 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'pathlib'");
387 }
388 }
389
390 return module_import_hard_pathlib;
391}
392#endif
393
394/* C helper for hard import of module "pathlib._abc" import. */
395#if PYTHON_VERSION >= 0x3d0
396PyObject *IMPORT_HARD_PATHLIB___ABC(void) {
397 static PyObject *module_import_hard_pathlib___abc = NULL;
398
399 if (module_import_hard_pathlib___abc == NULL) {
400 module_import_hard_pathlib___abc = PyImport_ImportModule("pathlib._abc");
401
402 if (unlikely(module_import_hard_pathlib___abc == NULL)) {
403#ifndef __NUITKA_NO_ASSERT__
404 PyErr_PrintEx(0);
405#endif
406 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'pathlib._abc'");
407 }
408 }
409
410 return module_import_hard_pathlib___abc;
411}
412#endif
413
414/* C helper for hard import of module "pathlib._local" import. */
415#if PYTHON_VERSION >= 0x3d0
416PyObject *IMPORT_HARD_PATHLIB___LOCAL(void) {
417 static PyObject *module_import_hard_pathlib___local = NULL;
418
419 if (module_import_hard_pathlib___local == NULL) {
420 module_import_hard_pathlib___local = PyImport_ImportModule("pathlib._local");
421
422 if (unlikely(module_import_hard_pathlib___local == NULL)) {
423#ifndef __NUITKA_NO_ASSERT__
424 PyErr_PrintEx(0);
425#endif
426 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'pathlib._local'");
427 }
428 }
429
430 return module_import_hard_pathlib___local;
431}
432#endif
433
434/* C helper for hard import of module "pkg_resources" import. */
435PyObject *IMPORT_HARD_PKG_RESOURCES(void) {
436 static PyObject *module_import_hard_pkg_resources = NULL;
437
438 if (module_import_hard_pkg_resources == NULL) {
439 module_import_hard_pkg_resources = PyImport_ImportModule("pkg_resources");
440
441 if (unlikely(module_import_hard_pkg_resources == NULL)) {
442 return NULL;
443 }
444 }
445
446 return module_import_hard_pkg_resources;
447}
448
449/* C helper for hard import of module "pkgutil" import. */
450PyObject *IMPORT_HARD_PKGUTIL(void) {
451 static PyObject *module_import_hard_pkgutil = NULL;
452
453 if (module_import_hard_pkgutil == NULL) {
454 module_import_hard_pkgutil = PyImport_ImportModule("pkgutil");
455
456 if (unlikely(module_import_hard_pkgutil == NULL)) {
457#ifndef __NUITKA_NO_ASSERT__
458 PyErr_PrintEx(0);
459#endif
460 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'pkgutil'");
461 }
462 }
463
464 return module_import_hard_pkgutil;
465}
466
467/* C helper for hard import of module "posixpath" import. */
468PyObject *IMPORT_HARD_POSIXPATH(void) {
469 static PyObject *module_import_hard_posixpath = NULL;
470
471 if (module_import_hard_posixpath == NULL) {
472 module_import_hard_posixpath = PyImport_ImportModule("posixpath");
473
474 if (unlikely(module_import_hard_posixpath == NULL)) {
475#ifndef __NUITKA_NO_ASSERT__
476 PyErr_PrintEx(0);
477#endif
478 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'posixpath'");
479 }
480 }
481
482 return module_import_hard_posixpath;
483}
484
485/* C helper for hard import of module "site" import. */
486PyObject *IMPORT_HARD_SITE(void) {
487 static PyObject *module_import_hard_site = NULL;
488
489 if (module_import_hard_site == NULL) {
490 module_import_hard_site = PyImport_ImportModule("site");
491
492 if (unlikely(module_import_hard_site == NULL)) {
493 return NULL;
494 }
495 }
496
497 return module_import_hard_site;
498}
499
500/* C helper for hard import of module "sys" import. */
501PyObject *IMPORT_HARD_SYS(void) {
502 static PyObject *module_import_hard_sys = NULL;
503
504 if (module_import_hard_sys == NULL) {
505 module_import_hard_sys = PyImport_ImportModule("sys");
506
507 if (unlikely(module_import_hard_sys == NULL)) {
508#ifndef __NUITKA_NO_ASSERT__
509 PyErr_PrintEx(0);
510#endif
511 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'sys'");
512 }
513 }
514
515 return module_import_hard_sys;
516}
517
518/* C helper for hard import of module "sysconfig" import. */
519PyObject *IMPORT_HARD_SYSCONFIG(void) {
520 static PyObject *module_import_hard_sysconfig = NULL;
521
522 if (module_import_hard_sysconfig == NULL) {
523 module_import_hard_sysconfig = PyImport_ImportModule("sysconfig");
524
525 if (unlikely(module_import_hard_sysconfig == NULL)) {
526#ifndef __NUITKA_NO_ASSERT__
527 PyErr_PrintEx(0);
528#endif
529 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'sysconfig'");
530 }
531 }
532
533 return module_import_hard_sysconfig;
534}
535
536/* C helper for hard import of module "tensorflow" import. */
537PyObject *IMPORT_HARD_TENSORFLOW(void) {
538 static PyObject *module_import_hard_tensorflow = NULL;
539
540 if (module_import_hard_tensorflow == NULL) {
541 module_import_hard_tensorflow = PyImport_ImportModule("tensorflow");
542
543 if (unlikely(module_import_hard_tensorflow == NULL)) {
544 return NULL;
545 }
546 }
547
548 return module_import_hard_tensorflow;
549}
550
551/* C helper for hard import of module "types" import. */
552PyObject *IMPORT_HARD_TYPES(void) {
553 static PyObject *module_import_hard_types = NULL;
554
555 if (module_import_hard_types == NULL) {
556 module_import_hard_types = PyImport_ImportModule("types");
557
558 if (unlikely(module_import_hard_types == NULL)) {
559#ifndef __NUITKA_NO_ASSERT__
560 PyErr_PrintEx(0);
561#endif
562 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'types'");
563 }
564 }
565
566 return module_import_hard_types;
567}
568
569/* C helper for hard import of module "typing" import. */
570#if PYTHON_VERSION >= 0x350
571PyObject *IMPORT_HARD_TYPING(void) {
572 static PyObject *module_import_hard_typing = NULL;
573
574 if (module_import_hard_typing == NULL) {
575 module_import_hard_typing = PyImport_ImportModule("typing");
576
577 if (unlikely(module_import_hard_typing == NULL)) {
578#ifndef __NUITKA_NO_ASSERT__
579 PyErr_PrintEx(0);
580#endif
581 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'typing'");
582 }
583 }
584
585 return module_import_hard_typing;
586}
587#endif
588
589/* C helper for hard import of module "unittest" import. */
590PyObject *IMPORT_HARD_UNITTEST(void) {
591 static PyObject *module_import_hard_unittest = NULL;
592
593 if (module_import_hard_unittest == NULL) {
594 module_import_hard_unittest = PyImport_ImportModule("unittest");
595
596 if (unlikely(module_import_hard_unittest == NULL)) {
597#ifndef __NUITKA_NO_ASSERT__
598 PyErr_PrintEx(0);
599#endif
600 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'unittest'");
601 }
602 }
603
604 return module_import_hard_unittest;
605}
606
607/* C helper for hard import of module "unittest.mock" import. */
608#if PYTHON_VERSION >= 0x300
609PyObject *IMPORT_HARD_UNITTEST__MOCK(void) {
610 static PyObject *module_import_hard_unittest__mock = NULL;
611
612 if (module_import_hard_unittest__mock == NULL) {
613 module_import_hard_unittest__mock = PyImport_ImportModule("unittest.mock");
614
615 if (unlikely(module_import_hard_unittest__mock == NULL)) {
616#ifndef __NUITKA_NO_ASSERT__
617 PyErr_PrintEx(0);
618#endif
619 NUITKA_ERROR_EXIT("Unexpected failure of hard import of 'unittest.mock'");
620 }
621 }
622
623 return module_import_hard_unittest__mock;
624}
625#endif
626
627// Part of "Nuitka", an optimizing Python compiler that is compatible and
628// integrates with CPython, but also works on its own.
629//
630// Licensed under the GNU Affero General Public License, Version 3 (the "License");
631// you may not use this file except in compliance with the License.
632// You may obtain a copy of the License at
633//
634// http://www.gnu.org/licenses/agpl.txt
635//
636// Unless required by applicable law or agreed to in writing, software
637// distributed under the License is distributed on an "AS IS" BASIS,
638// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
639// See the License for the specific language governing permissions and
640// limitations under the License.