forked from holzschu/python3_ios
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Python_Modules.patch
1588 lines (1544 loc) · 56.4 KB
/
Python_Modules.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -Naur tmp/Python-3.7.1/Modules/Setup Python-3.7.1/Modules/Setup
--- tmp/Python-3.7.1/Modules/Setup 1970-01-01 01:00:00.000000000 +0100
+++ Python-3.7.1/Modules/Setup 2018-12-20 22:14:05.000000000 +0100
@@ -0,0 +1,369 @@
+# -*- makefile -*-
+# The file Setup is used by the makesetup script to construct the files
+# Makefile and config.c, from Makefile.pre and config.c.in,
+# respectively. The file Setup itself is initially copied from
+# Setup.dist; once it exists it will not be overwritten, so you can edit
+# Setup to your heart's content. Note that Makefile.pre is created
+# from Makefile.pre.in by the toplevel configure script.
+
+# (VPATH notes: Setup and Makefile.pre are in the build directory, as
+# are Makefile and config.c; the *.in and *.dist files are in the source
+# directory.)
+
+# Each line in this file describes one or more optional modules.
+# Modules configured here will not be compiled by the setup.py script,
+# so the file can be used to override setup.py's behavior.
+# Tag lines containing just the word "*static*", "*shared*" or "*disabled*"
+# (without the quotes but with the stars) are used to tag the following module
+# descriptions. Tag lines may alternate throughout this file. Modules are
+# built statically when they are preceded by a "*static*" tag line or when
+# there is no tag line between the start of the file and the module
+# description. Modules are built as a shared library when they are preceded by
+# a "*shared*" tag line. Modules are not built at all, not by the Makefile,
+# nor by the setup.py script, when they are preceded by a "*disabled*" tag
+# line.
+
+# Lines have the following structure:
+#
+# <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...]
+#
+# <sourcefile> is anything ending in .c (.C, .cc, .c++ are C++ files)
+# <cpparg> is anything starting with -I, -D, -U or -C
+# <library> is anything ending in .a or beginning with -l or -L
+# <module> is anything else but should be a valid Python
+# identifier (letters, digits, underscores, beginning with non-digit)
+#
+# (As the makesetup script changes, it may recognize some other
+# arguments as well, e.g. *.so and *.sl as libraries. See the big
+# case statement in the makesetup script.)
+#
+# Lines can also have the form
+#
+# <name> = <value>
+#
+# which defines a Make variable definition inserted into Makefile.in
+#
+# The build process works like this:
+#
+# 1. Build all modules that are declared as static in Modules/Setup,
+# combine them into libpythonxy.a, combine that into python.
+# 2. Build all modules that are listed as shared in Modules/Setup.
+# 3. Invoke setup.py. That builds all modules that
+# a) are not builtin, and
+# b) are not listed in Modules/Setup, and
+# c) can be build on the target
+#
+# Therefore, modules declared to be shared will not be
+# included in the config.c file, nor in the list of objects to be
+# added to the library archive, and their linker options won't be
+# added to the linker options. Rules to create their .o files and
+# their shared libraries will still be added to the Makefile, and
+# their names will be collected in the Make variable SHAREDMODS. This
+# is used to build modules as shared libraries. (They can be
+# installed using "make sharedinstall", which is implied by the
+# toplevel "make install" target.) (For compatibility,
+# *noconfig* has the same effect as *shared*.)
+#
+# NOTE: As a standard policy, as many modules as can be supported by a
+# platform should be present. The distribution comes with all modules
+# enabled that are supported by most platforms and don't require you
+# to ftp sources from elsewhere.
+
+
+# Some special rules to define PYTHONPATH.
+# Edit the definitions below to indicate which options you are using.
+# Don't add any whitespace or comments!
+
+# Directories where library files get installed.
+# DESTLIB is for Python modules; MACHDESTLIB for shared libraries.
+DESTLIB=$(LIBDEST)
+MACHDESTLIB=$(BINLIBDEST)
+
+# NOTE: all the paths are now relative to the prefix that is computed
+# at run time!
+
+# Standard path -- don't edit.
+# No leading colon since this is the first entry.
+# Empty since this is now just the runtime prefix.
+DESTPATH=
+
+# Site specific path components -- should begin with : if non-empty
+SITEPATH=
+
+# Standard path components for test modules
+TESTPATH=
+
+COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
+PYTHONPATH=$(COREPYTHONPATH)
+
+
+# The modules listed here can't be built as shared libraries for
+# various reasons; therefore they are listed here instead of in the
+# normal order.
+
+# This only contains the minimal set of modules required to run the
+# setup.py script in the root of the Python source tree.
+
+posix -DPy_BUILD_CORE posixmodule.c # posix (UNIX) system calls
+errno errnomodule.c # posix (UNIX) errno values
+pwd pwdmodule.c # this is needed to find out the user's home dir
+ # if $HOME is not set
+_sre _sre.c # Fredrik Lundh's new regular expressions
+_codecs _codecsmodule.c # access to the builtin codecs and codec registry
+_weakref _weakref.c # weak references
+_functools -DPy_BUILD_CORE _functoolsmodule.c # Tools for working with functions and callable objects
+_operator _operator.c # operator.add() and similar goodies
+_collections _collectionsmodule.c # Container types
+_abc _abc.c # Abstract base classes
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
+_signal -DPy_BUILD_CORE signalmodule.c
+_stat _stat.c # stat.h interface
+time -DPy_BUILD_CORE timemodule.c # -lm # time operations and variables
+_thread -DPy_BUILD_CORE _threadmodule.c # low-level threading interface
+
+# access to ISO C locale support
+_locale _localemodule.c # -lintl
+
+# Standard I/O baseline
+_io -DPy_BUILD_CORE -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
+
+# The zipimport module is always imported at startup. Having it as a
+# builtin module avoids some bootstrapping problems and reduces overhead.
+zipimport -DPy_BUILD_CORE zipimport.c
+
+# faulthandler module
+faulthandler faulthandler.c
+
+# debug tool to trace memory blocks allocated by Python
+_tracemalloc _tracemalloc.c hashtable.c
+
+# The rest of the modules listed in this file are all commented out by
+# default. Usually they can be detected and built as dynamically
+# loaded modules by the new setup.py script added in Python 2.1. If
+# you're on a platform that doesn't support dynamic loading, want to
+# compile modules statically into the Python binary, or need to
+# specify some odd set of compiler switches, you can uncomment the
+# appropriate lines below.
+
+# ======================================================================
+
+# The Python symtable module depends on .h files that setup.py doesn't track
+_symtable symtablemodule.c
+
+# Uncommenting the following line tells makesetup that all following
+# modules are to be built as shared libraries (see above for more
+# detail; also note that *static* or *disabled* cancels this effect):
+
+#*shared*
+
+# GNU readline. Unlike previous Python incarnations, GNU readline is
+# now incorporated in an optional module, configured in the Setup file
+# instead of by a configure script switch. You may have to insert a
+# -L option pointing to the directory where libreadline.* lives,
+# and you may have to change -ltermcap to -ltermlib or perhaps remove
+# it, depending on your system -- see the GNU readline instructions.
+# It's okay for this to be a shared library, too.
+
+#readline readline.c -lreadline -ltermcap
+
+
+# Modules that should always be present (non UNIX dependent):
+
+#array arraymodule.c # array objects
+#cmath cmathmodule.c _math.c # -lm # complex math library functions
+#math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
+#_contextvars _contextvarsmodule.c # Context Variables
+#_struct _struct.c # binary structure packing/unpacking
+#_weakref _weakref.c # basic weak reference support
+#_testcapi _testcapimodule.c # Python C API test module
+#_random _randommodule.c # Random number generator
+#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
+#_pickle _pickle.c # pickle accelerator
+#_datetime _datetimemodule.c # datetime accelerator
+#_bisect _bisectmodule.c # Bisection algorithms
+#_heapq _heapqmodule.c # Heap queue algorithm
+#_asyncio _asynciomodule.c # Fast asyncio Future
+
+#unicodedata unicodedata.c # static Unicode character database
+
+
+# Modules with some UNIX dependencies -- on by default:
+# (If you have a really backward UNIX, select and socket may not be
+# supported...)
+
+#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+#spwd spwdmodule.c # spwd(3)
+#grp grpmodule.c # grp(3)
+#select selectmodule.c # select(2); not on ancient System V
+
+# Memory-mapped files (also works on Win32).
+#mmap mmapmodule.c
+
+# CSV file helper
+#_csv _csv.c
+
+# Socket module helper for socket(2)
+#_socket socketmodule.c
+
+# Socket module helper for SSL support; you must comment out the other
+# socket line above, and possibly edit the SSL variable:
+#SSL=/usr/local/ssl
+#_ssl _ssl.c \
+# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+# -L$(SSL)/lib -lssl -lcrypto
+
+# The crypt module is now disabled by default because it breaks builds
+# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+
+#_crypt _cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+# Some more UNIX dependent modules -- off by default, since these
+# are not supported by all UNIX systems:
+
+#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+#termios termios.c # Steen Lumholt's termios module
+#resource resource.c # Jeremy Hylton's rlimit interface
+
+#_posixsubprocess _posixsubprocess.c # POSIX subprocess module helper
+
+# Multimedia modules -- off by default.
+# These don't work for 64-bit platforms!!!
+# #993173 says audioop works on 64-bit platforms, though.
+# These represent audio samples or images as strings:
+
+#audioop audioop.c # Operations on audio samples
+
+
+# Note that the _md5 and _sha modules are normally only built if the
+# system does not have the OpenSSL libs containing an optimized version.
+
+# The _md5 module implements the RSA Data Security, Inc. MD5
+# Message-Digest Algorithm, described in RFC 1321.
+
+#_md5 md5module.c
+
+
+# The _sha module implements the SHA checksum algorithms.
+# (NIST's Secure Hash Algorithms.)
+#_sha1 sha1module.c
+#_sha256 sha256module.c
+#_sha512 sha512module.c
+#_sha3 _sha3/sha3module.c
+
+# _blake module
+#_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
+
+# The _tkinter module.
+#
+# The command for _tkinter is long and site specific. Please
+# uncomment and/or edit those parts as indicated. If you don't have a
+# specific extension (e.g. Tix or BLT), leave the corresponding line
+# commented out. (Leave the trailing backslashes in! If you
+# experience strange errors, you may want to join all uncommented
+# lines and remove the backslashes -- the backslash interpretation is
+# done by the shell's "read" command and it may not be implemented on
+# every system.
+
+# *** Always uncomment this (leave the leading underscore in!):
+# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+# -L/usr/local/lib \
+# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+# -I/usr/local/include \
+# *** Uncomment and edit to reflect where your X11 header files are:
+# -I/usr/X11R6/include \
+# *** Or uncomment this for Solaris:
+# -I/usr/openwin/include \
+# *** Uncomment and edit for Tix extension only:
+# -DWITH_TIX -ltix8.1.8.2 \
+# *** Uncomment and edit for BLT extension only:
+# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+# *** Uncomment and edit for PIL (TkImaging) extension only:
+# (See http://www.pythonware.com/products/pil/ for more info)
+# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
+# *** Uncomment and edit for TOGL extension only:
+# -DWITH_TOGL togl.c \
+# *** Uncomment and edit to reflect your Tcl/Tk versions:
+# -ltk8.2 -ltcl8.2 \
+# *** Uncomment and edit to reflect where your X11 libraries are:
+# -L/usr/X11R6/lib \
+# *** Or uncomment this for Solaris:
+# -L/usr/openwin/lib \
+# *** Uncomment these for TOGL extension only:
+# -lGL -lGLU -lXext -lXmu \
+# *** Uncomment for AIX:
+# -lld \
+# *** Always uncomment this; X11 libraries to link with:
+# -lX11
+
+# Lance Ellinghaus's syslog module
+#syslog syslogmodule.c # syslog daemon interface
+
+
+# Curses support, requiring the System V version of curses, often
+# provided by the ncurses library. e.g. on Linux, link with -lncurses
+# instead of -lcurses).
+
+#_curses _cursesmodule.c -lcurses -ltermcap
+# Wrapper for the panel library that's part of ncurses and SYSV curses.
+#_curses_panel _curses_panel.c -lpanel -lncurses
+
+
+# Modules that provide persistent dictionary-like semantics. You will
+# probably want to arrange for at least one of them to be available on
+# your machine, though none are defined by default because of library
+# dependencies. The Python module dbm/__init__.py provides an
+# implementation independent wrapper for these; dbm/dumb.py provides
+# similar functionality (but slower of course) implemented in Python.
+
+#_dbm _dbmmodule.c # dbm(3) may require -lndbm or similar
+
+# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
+
+#_gdbm _gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
+
+
+# Helper module for various ascii-encoders
+#binascii binascii.c
+
+# Fred Drake's interface to the Python parser
+#parser parsermodule.c
+
+
+# Andrew Kuchling's zlib module.
+# This require zlib 1.1.3 (or later).
+# See http://www.gzip.org/zlib/
+#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+
+# Interface to the Expat XML parser
+# More information on Expat can be found at www.libexpat.org.
+#
+#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
+
+# Hye-Shik Chang's CJKCodecs
+
+# multibytecodec is required for all the other CJK codec modules
+#_multibytecodec cjkcodecs/multibytecodec.c
+
+#_codecs_cn cjkcodecs/_codecs_cn.c
+#_codecs_hk cjkcodecs/_codecs_hk.c
+#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+#_codecs_jp cjkcodecs/_codecs_jp.c
+#_codecs_kr cjkcodecs/_codecs_kr.c
+#_codecs_tw cjkcodecs/_codecs_tw.c
+
+# Example -- included for reference only:
+# xx xxmodule.c
+
+# Another example -- the 'xxsubtype' module shows C-level subtyping in action
+xxsubtype xxsubtype.c
+
+# Uncommenting the following line tells makesetup that all following modules
+# are not built (see above for more detail).
+#
+#*disabled*
+#
+#_sqlite3 _tkinter _curses pyexpat
+#_codecs_jp _codecs_kr _codecs_tw unicodedata
diff -Naur tmp/Python-3.7.1/Modules/Setup.local Python-3.7.1/Modules/Setup.local
--- tmp/Python-3.7.1/Modules/Setup.local 1970-01-01 01:00:00.000000000 +0100
+++ Python-3.7.1/Modules/Setup.local 2018-12-20 22:14:05.000000000 +0100
@@ -0,0 +1 @@
+# Edit this file for local setup changes
diff -Naur tmp/Python-3.7.1/Modules/_asynciomodule.c Python-3.7.1/Modules/_asynciomodule.c
--- tmp/Python-3.7.1/Modules/_asynciomodule.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_asynciomodule.c 2019-02-26 18:03:47.000000000 +0100
@@ -3198,6 +3198,9 @@
Py_CLEAR(context_kwname);
+ cached_running_holder = NULL; // Not Py_CLEAR because there are no references to it
+ cached_running_holder_tsid = -1;
+
module_free_freelists();
}
diff -Naur tmp/Python-3.7.1/Modules/_ctypes/darwin/dlfcn.h Python-3.7.1/Modules/_ctypes/darwin/dlfcn.h
--- tmp/Python-3.7.1/Modules/_ctypes/darwin/dlfcn.h 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_ctypes/darwin/dlfcn.h 2018-12-20 22:14:05.000000000 +0100
@@ -61,7 +61,7 @@
#else
extern void * dlopen(const char *path, int mode);
extern void * dlsym(void * handle, const char *symbol);
-extern const char * dlerror(void);
+extern /* const */ char * dlerror(void);
extern int dlclose(void * handle);
extern int dladdr(const void *, Dl_info *);
#endif
diff -Naur tmp/Python-3.7.1/Modules/_datetimemodule.c Python-3.7.1/Modules/_datetimemodule.c
--- tmp/Python-3.7.1/Modules/_datetimemodule.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_datetimemodule.c 2019-01-20 15:36:58.000000000 +0100
@@ -4803,21 +4803,33 @@
}
/* Return new datetime from _strptime.strptime_datetime(). */
+#ifdef TARGET_OS_IPHONE
+// Need to have static identifiers outside functions in iOS_system
+_Py_IDENTIFIER(_strptime_datetime);
+#endif
static PyObject *
datetime_strptime(PyObject *cls, PyObject *args)
{
static PyObject *module = NULL;
PyObject *string, *format;
+#ifndef TARGET_OS_IPHONE
_Py_IDENTIFIER(_strptime_datetime);
+#endif
if (!PyArg_ParseTuple(args, "UU:strptime", &string, &format))
return NULL;
+#ifndef TARGET_OS_IPHONE
if (module == NULL) {
module = PyImport_ImportModuleNoBlock("_strptime");
if (module == NULL)
return NULL;
}
+#else
+ module = PyImport_ImportModuleNoBlock("_strptime");
+ if (module == NULL)
+ return NULL;
+#endif
return _PyObject_CallMethodIdObjArgs(module, &PyId__strptime_datetime,
cls, string, format, NULL);
}
diff -Naur tmp/Python-3.7.1/Modules/_decimal/_decimal.c Python-3.7.1/Modules/_decimal/_decimal.c
--- tmp/Python-3.7.1/Modules/_decimal/_decimal.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_decimal/_decimal.c 2019-02-08 13:10:43.000000000 +0100
@@ -5428,6 +5428,164 @@
{ NULL, NULL, 1, NULL }
};
+
+static void reset_PyDec_Type() {
+ PyDec_Type.tp_itemsize = 0;
+ PyDec_Type.tp_dealloc = (destructor) dec_dealloc;
+ PyDec_Type.tp_print = 0;
+ PyDec_Type.tp_getattr = (getattrfunc) 0;
+ PyDec_Type.tp_setattr = (setattrfunc) 0;
+ // PyDec_Type.tp_reserved = 0;
+ PyDec_Type.tp_repr = (reprfunc) dec_repr;
+ PyDec_Type.tp_as_number = &dec_number_methods;
+ PyDec_Type.tp_as_sequence = 0;
+ PyDec_Type.tp_as_mapping = 0;
+ PyDec_Type.tp_hash = (hashfunc) dec_hash;
+ PyDec_Type.tp_call = 0;
+ PyDec_Type.tp_str = (reprfunc) dec_str;
+ PyDec_Type.tp_getattro = (getattrofunc) PyObject_GenericGetAttr;
+ PyDec_Type.tp_setattro = (setattrofunc) 0;
+ PyDec_Type.tp_as_buffer = (PyBufferProcs *) 0;
+ PyDec_Type.tp_flags = (Py_TPFLAGS_DEFAULT| Py_TPFLAGS_BASETYPE);
+ PyDec_Type.tp_doc = doc_decimal;
+ PyDec_Type.tp_traverse = 0;
+ PyDec_Type.tp_clear = 0;
+ PyDec_Type.tp_richcompare = dec_richcompare;
+ PyDec_Type.tp_weaklistoffset = 0;
+ PyDec_Type.tp_iter = 0;
+ PyDec_Type.tp_iternext = 0;
+ PyDec_Type.tp_methods = dec_methods;
+ PyDec_Type.tp_members = 0;
+ PyDec_Type.tp_getset = dec_getsets;
+ PyDec_Type.tp_base = 0;
+ PyDec_Type.tp_dict = 0;
+ PyDec_Type.tp_descr_get = 0;
+ PyDec_Type.tp_descr_set = 0;
+ PyDec_Type.tp_dictoffset = 0;
+ PyDec_Type.tp_init = 0;
+ PyDec_Type.tp_alloc = 0;
+ PyDec_Type.tp_new = dec_new;
+ PyDec_Type.tp_free = PyObject_Del;
+
+}
+
+static void reset_PyDecContext_Type() {
+ PyDecContext_Type.tp_itemsize = 0;
+ PyDecContext_Type.tp_dealloc = (destructor) context_dealloc;
+ PyDecContext_Type.tp_print = 0;
+ PyDecContext_Type.tp_getattr = (getattrfunc) 0;
+ PyDecContext_Type.tp_setattr = (setattrfunc) 0;
+ // PyDecContext_Type.tp_reserved = 0;
+ PyDecContext_Type.tp_repr = (reprfunc) context_repr;
+ PyDecContext_Type.tp_as_number = 0;
+ PyDecContext_Type.tp_as_sequence = 0;
+ PyDecContext_Type.tp_as_mapping = 0;
+ PyDecContext_Type.tp_hash = (hashfunc) 0;
+ PyDecContext_Type.tp_call = 0;
+ PyDecContext_Type.tp_str = (reprfunc) context_repr;
+ PyDecContext_Type.tp_getattro = (getattrofunc) context_getattr;
+ PyDecContext_Type.tp_setattro = (setattrofunc) context_setattr;
+ PyDecContext_Type.tp_as_buffer = (PyBufferProcs *) 0;
+ PyDecContext_Type.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE;
+ PyDecContext_Type.tp_doc = doc_context;
+ PyDecContext_Type.tp_traverse = 0;
+ PyDecContext_Type.tp_clear = 0;
+ PyDecContext_Type.tp_richcompare = 0;
+ PyDecContext_Type.tp_weaklistoffset = 0;
+ PyDecContext_Type.tp_iter = 0;
+ PyDecContext_Type.tp_iternext = 0;
+ PyDecContext_Type.tp_methods = context_methods;
+ PyDecContext_Type.tp_members = 0;
+ PyDecContext_Type.tp_getset = context_getsets;
+ PyDecContext_Type.tp_base = 0;
+ PyDecContext_Type.tp_dict = 0;
+ PyDecContext_Type.tp_descr_get = 0;
+ PyDecContext_Type.tp_descr_set = 0;
+ PyDecContext_Type.tp_dictoffset = 0;
+ PyDecContext_Type.tp_init = context_init;
+ PyDecContext_Type.tp_alloc = 0;
+ PyDecContext_Type.tp_new = context_new;
+ PyDecContext_Type.tp_free = PyObject_Del;
+}
+
+static void reset_PyDecContextManager_Type() {
+ PyDecContextManager_Type.tp_itemsize = 0;
+ PyDecContextManager_Type.tp_dealloc = (destructor) ctxmanager_dealloc;
+ PyDecContextManager_Type.tp_print = 0;
+ PyDecContextManager_Type.tp_getattr = (getattrfunc) 0;
+ PyDecContextManager_Type.tp_setattr = (setattrfunc) 0;
+ // PyDecContextManager_Type.tp_reserved = 0;
+ PyDecContextManager_Type.tp_repr = (reprfunc) 0;
+ PyDecContextManager_Type.tp_as_number = 0;
+ PyDecContextManager_Type.tp_as_sequence = 0;
+ PyDecContextManager_Type.tp_as_mapping = 0;
+ PyDecContextManager_Type.tp_hash = 0;
+ PyDecContextManager_Type.tp_call = 0;
+ PyDecContextManager_Type.tp_str = 0;
+ PyDecContextManager_Type.tp_getattro = (getattrofunc) PyObject_GenericGetAttr;
+ PyDecContextManager_Type.tp_setattro = (setattrofunc) 0;
+ PyDecContextManager_Type.tp_as_buffer = (PyBufferProcs *) 0;
+ PyDecContextManager_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ PyDecContextManager_Type.tp_doc = 0;
+ PyDecContextManager_Type.tp_traverse = 0;
+ PyDecContextManager_Type.tp_clear = 0;
+ PyDecContextManager_Type.tp_richcompare = 0;
+ PyDecContextManager_Type.tp_weaklistoffset = 0;
+ PyDecContextManager_Type.tp_iter = 0;
+ PyDecContextManager_Type.tp_iternext = 0;
+ PyDecContextManager_Type.tp_methods = ctxmanager_methods;
+}
+
+static void reset_PyDecSignalDictMixin_Type() {
+ PyDecSignalDictMixin_Type.tp_itemsize = 0;
+ PyDecSignalDictMixin_Type.tp_dealloc = 0;
+ PyDecSignalDictMixin_Type.tp_print = 0;
+ PyDecSignalDictMixin_Type.tp_getattr = (getattrfunc) 0;
+ PyDecSignalDictMixin_Type.tp_setattr = (setattrfunc) 0;
+ // PyDecSignalDictMixin_Type.tp_reserved = 0;
+ PyDecSignalDictMixin_Type.tp_repr = (reprfunc) signaldict_repr;
+ PyDecSignalDictMixin_Type.tp_as_number = 0;
+ PyDecSignalDictMixin_Type.tp_as_sequence = 0;
+ PyDecSignalDictMixin_Type.tp_as_mapping = &signaldict_as_mapping;
+ PyDecSignalDictMixin_Type.tp_hash = PyObject_HashNotImplemented;
+ PyDecSignalDictMixin_Type.tp_call = 0;
+ PyDecSignalDictMixin_Type.tp_str = (reprfunc) 0;
+ PyDecSignalDictMixin_Type.tp_getattro = PyObject_GenericGetAttr;
+ PyDecSignalDictMixin_Type.tp_setattro = (setattrofunc) 0;
+ PyDecSignalDictMixin_Type.tp_as_buffer = (PyBufferProcs *) 0;
+ PyDecSignalDictMixin_Type.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC;
+ PyDecSignalDictMixin_Type.tp_doc = 0;
+ PyDecSignalDictMixin_Type.tp_traverse = 0;
+ PyDecSignalDictMixin_Type.tp_clear = 0;
+ PyDecSignalDictMixin_Type.tp_richcompare = signaldict_richcompare;
+ PyDecSignalDictMixin_Type.tp_weaklistoffset = 0;
+ PyDecSignalDictMixin_Type.tp_iter = (getiterfunc)signaldict_iter;
+ PyDecSignalDictMixin_Type.tp_iternext = 0;
+ PyDecSignalDictMixin_Type.tp_methods = signaldict_methods;
+ PyDecSignalDictMixin_Type.tp_members = 0;
+ PyDecSignalDictMixin_Type.tp_getset = 0;
+ PyDecSignalDictMixin_Type.tp_base = 0;
+ PyDecSignalDictMixin_Type.tp_dict = 0;
+ PyDecSignalDictMixin_Type.tp_descr_get = 0;
+ PyDecSignalDictMixin_Type.tp_descr_set = 0;
+ PyDecSignalDictMixin_Type.tp_dictoffset = 0;
+ PyDecSignalDictMixin_Type.tp_init = (initproc)signaldict_init;
+ PyDecSignalDictMixin_Type.tp_alloc = 0;
+ PyDecSignalDictMixin_Type.tp_new = PyType_GenericNew;
+
+}
+
+static void reset_decimal_types() {
+ // iOS: reset the types to their default values, so they are back to their
+ // original self after a PyFinalize() / PyInitialize() pair of calls.
+ // We cannot call this function as the destructor, as type.dealloc() members
+ // will be called later, in another destructor. So we call it in the initializer.
+ reset_PyDec_Type();
+ reset_PyDecContext_Type();
+ reset_PyDecContextManager_Type();
+ reset_PyDecSignalDictMixin_Type();
+}
+
static struct PyModuleDef _decimal_module = {
PyModuleDef_HEAD_INIT,
"decimal",
@@ -5513,7 +5671,6 @@
return NULL;
}
-
PyMODINIT_FUNC
PyInit__decimal(void)
{
@@ -5544,6 +5701,9 @@
goto error;
}
+ // iOS: reset all types to their default values (0, mostly)
+ reset_decimal_types();
+
/* Init external C-API functions */
_py_long_multiply = PyLong_Type.tp_as_number->nb_multiply;
_py_long_floor_divide = PyLong_Type.tp_as_number->nb_floor_divide;
@@ -5553,7 +5713,6 @@
"as_integer_ratio"));
ASSIGN_PTR(_py_long_bit_length, cfunc_noargs(&PyLong_Type, "bit_length"));
-
/* Init types */
PyDec_Type.tp_base = &PyBaseObject_Type;
PyDecContext_Type.tp_base = &PyBaseObject_Type;
diff -Naur tmp/Python-3.7.1/Modules/_decimal/libmpdec/context.c Python-3.7.1/Modules/_decimal/libmpdec/context.c
--- tmp/Python-3.7.1/Modules/_decimal/libmpdec/context.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_decimal/libmpdec/context.c 2019-06-03 21:37:04.000000000 +0200
@@ -30,7 +30,8 @@
#include <stdio.h>
#include <string.h>
#include <signal.h>
-
+// iOS:
+#include <TargetConditionals.h>
void
mpd_dflt_traphandler(mpd_context_t *ctx UNUSED)
@@ -51,8 +52,11 @@
static int minalloc_is_set = 0;
if (minalloc_is_set) {
+ // iOS: silence this warning.
+#ifndef TARGET_OS_IPHONE
mpd_err_warn("mpd_setminalloc: ignoring request to set "
"MPD_MINALLOC a second time\n");
+#endif
return;
}
if (n < MPD_MINALLOC_MIN || n > MPD_MINALLOC_MAX) {
diff -Naur tmp/Python-3.7.1/Modules/_hashopenssl.c Python-3.7.1/Modules/_hashopenssl.c
--- tmp/Python-3.7.1/Modules/_hashopenssl.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_hashopenssl.c 2018-12-24 16:05:10.000000000 +0100
@@ -46,6 +46,7 @@
#include <openssl/hmac.h>
#else
/* OpenSSL >= 1.1.0 */
+# define OPENSSL_VERSION_1_1 1
#define HAS_FAST_PKCS5_PBKDF2_HMAC 1
#endif
@@ -1053,17 +1054,23 @@
/* Initialize this module. */
+static void
+_hashlib_free(PyObject *m)
+{
+ // Do nothing (for now), but handle is available
+ // OPENSSL_cleanup();
+}
static struct PyModuleDef _hashlibmodule = {
PyModuleDef_HEAD_INIT,
- "_hashlib",
- NULL,
- -1,
- EVP_functions,
- NULL,
- NULL,
- NULL,
- NULL
+ "_hashlib", /* m_name */
+ NULL, /* m_doc */
+ -1, /* m_size */
+ EVP_functions, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ (freefunc)_hashlib_free /* m_free */
};
PyMODINIT_FUNC
diff -Naur tmp/Python-3.7.1/Modules/_posixsubprocess.c Python-3.7.1/Modules/_posixsubprocess.c
--- tmp/Python-3.7.1/Modules/_posixsubprocess.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_posixsubprocess.c 2019-06-10 15:57:19.000000000 +0200
@@ -45,7 +45,6 @@
#define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0)
-
/* If gc was disabled, call gc.enable(). Return 0 on success. */
static int
_enable_gc(int need_to_reenable_gc, PyObject *gc_module)
@@ -376,6 +375,7 @@
#endif /* else NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */
+
/*
* This function is code executed in the child process immediately after fork
* to set things up and call exec().
@@ -411,6 +411,7 @@
if (make_inheritable(py_fds_to_keep, errpipe_write) < 0)
goto error;
+#ifndef TARGET_OS_IPHONE
/* Close parent's pipe ends. */
if (p2cwrite != -1)
POSIX_CALL(close(p2cwrite));
@@ -419,7 +420,7 @@
if (errread != -1)
POSIX_CALL(close(errread));
POSIX_CALL(close(errpipe_read));
-
+#endif // TARGET_OS_IPHONE
/* When duping fds, if there arises a situation where one of the fds is
either 0, 1 or 2, it is possible that it is overwritten (#12607). */
if (c2pwrite == 0) {
@@ -464,6 +465,9 @@
/* We no longer manually close p2cread, c2pwrite, and errwrite here as
* _close_open_fds takes care when it is not already non-inheritable. */
+#ifdef TARGET_OS_IPHONE
+ const char *currentDir = getcwd(NULL, 0);
+#endif
if (cwd)
POSIX_CALL(chdir(cwd));
@@ -489,35 +493,52 @@
errno = 0; /* We don't want to report an OSError. */
goto error;
}
- /* Py_DECREF(result); - We're about to exec so why bother? */
+ Py_DECREF(result); /* - We're about to exec so why bother? */
}
-
+#ifndef TARGET_OS_IPHONE
/* close FDs after executing preexec_fn, which might open FDs */
if (close_fds) {
/* TODO HP-UX could use pstat_getproc() if anyone cares about it. */
- _close_open_fds(3, py_fds_to_keep);
+ _close_open_fds(3, py_fds_to_keep); // THIS IS WHERE THE ISSUE IS!
}
-
+#endif
/* This loop matches the Lib/os.py _execvpe()'s PATH search when */
/* given the executable_list generated by Lib/subprocess.py. */
saved_errno = 0;
for (i = 0; exec_array[i] != NULL; ++i) {
const char *executable = exec_array[i];
if (envp) {
- execve(executable, argv, envp);
+ saved_errno = execve(executable, argv, envp);
+#ifdef TARGET_OS_IPHONE
+ break;
+#endif
} else {
- execv(executable, argv);
+ saved_errno = execv(executable, argv);
+#ifdef TARGET_OS_IPHONE
+ break;
+#endif
}
if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
saved_errno = errno;
}
}
+#ifdef TARGET_OS_IPHONE
+ // Don't chdir back yet, we need to finish executing the command.
+ // Will have to add it to python script, after the wait().
+ // POSIX_CALL(chdir(currentDir));
+ if (saved_errno == 0) return; // We're not supposed to return from execv, but on iOS we do
+#endif
/* Report the first exec error, not the last. */
if (saved_errno)
errno = saved_errno;
error:
+ // Something went wrong.
saved_errno = errno;
+#ifdef TARGET_OS_IPHONE
+ // Move back to previous directory:
+ chdir(currentDir);
+#endif
/* Report the posix error to our parent process. */
/* We ignore all write() return values as the total size of our writes is
less than PIPEBUF and we cannot do anything about an error anyways.
@@ -545,7 +566,6 @@
}
}
-
static PyObject *
subprocess_fork_exec(PyObject* self, PyObject *args)
{
@@ -676,8 +696,12 @@
need_after_fork = 1;
}
+#ifndef TARGET_OS_IPHONE
pid = fork();
if (pid == 0) {
+#else
+ pid = ios_fork();
+#endif
/* Child process */
/*
* Code from here to _exit() must only use async-signal-safe functions,
@@ -692,15 +716,24 @@
* to avoid deadlock... */
PyOS_AfterFork_Child();
}
-
+ // If we're trying to start multiple pythons, ios_system will
+ // take care of it and load a different framework.
+ // In theory, we could do the same with Py_NewInterpreter,
+ // but in practice Py_NewInterpreter() works poorly with
+ // multiple threads and sockets.
+ Py_BEGIN_ALLOW_THREADS
child_exec(exec_array, argv, envp, cwd,
p2cread, p2cwrite, c2pread, c2pwrite,
errread, errwrite, errpipe_read, errpipe_write,
close_fds, restore_signals, call_setsid,
py_fds_to_keep, preexec_fn, preexec_fn_args_tuple);
+ Py_END_ALLOW_THREADS
+#ifndef TARGET_OS_IPHONE
_exit(255);
- return NULL; /* Dead code to avoid a potential compiler warning. */
+ return NULL;
}
+#endif
+ // TODO: cleanup memory allocation in iOS
/* Parent (original) process */
if (pid == -1) {
/* Capture errno for the exception. */
diff -Naur tmp/Python-3.7.1/Modules/_ssl.c Python-3.7.1/Modules/_ssl.c
--- tmp/Python-3.7.1/Modules/_ssl.c 2018-10-20 08:04:19.000000000 +0200
+++ Python-3.7.1/Modules/_ssl.c 2019-06-04 09:54:23.000000000 +0200
@@ -5651,19 +5651,29 @@
for documentation.");
+static void
+_ssl_free(PyObject *m)
+{
+ // Do nothing (for now), but handle is available
+ // OPENSSL_cleanup();
+}
+
+
static struct PyModuleDef _sslmodule = {
PyModuleDef_HEAD_INIT,
- "_ssl",
- module_doc,
- -1,
- PySSL_methods,
- NULL,
- NULL,
- NULL,
- NULL
+ "_ssl", /* m_name */
+ module_doc, /* m_doc */
+ -1, /* m_size */
+ PySSL_methods, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ (freefunc)_ssl_free /* m_free */
};
+
+
static void
parse_openssl_version(unsigned long libver,
unsigned int *major, unsigned int *minor,
diff -Naur tmp/Python-3.7.1/Modules/config.c Python-3.7.1/Modules/config.c
--- tmp/Python-3.7.1/Modules/config.c 1970-01-01 01:00:00.000000000 +0100
+++ Python-3.7.1/Modules/config.c 2019-05-31 14:48:46.000000000 +0200
@@ -0,0 +1,271 @@
+/* Generated automatically from ./Modules/config.c.in by makesetup. */
+/* -*- C -*- ***********************************************
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+******************************************************************/
+
+/* Module configuration */
+
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
+
+/* This file contains the table of built-in modules.
+ See create_builtin() in import.c. */
+
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+PyMODINIT_FUNC PyInit_posix(void);
+PyMODINIT_FUNC PyInit_errno(void);
+PyMODINIT_FUNC PyInit_pwd(void);
+PyMODINIT_FUNC PyInit__sre(void);
+PyMODINIT_FUNC PyInit__codecs(void);
+PyMODINIT_FUNC PyInit__weakref(void);
+PyMODINIT_FUNC PyInit__functools(void);
+PyMODINIT_FUNC PyInit__operator(void);
+PyMODINIT_FUNC PyInit__collections(void);
+PyMODINIT_FUNC PyInit__abc(void);
+PyMODINIT_FUNC PyInit_itertools(void);
+PyMODINIT_FUNC PyInit_atexit(void);
+PyMODINIT_FUNC PyInit__signal(void);
+PyMODINIT_FUNC PyInit__stat(void);
+PyMODINIT_FUNC PyInit_time(void);
+PyMODINIT_FUNC PyInit__thread(void);
+PyMODINIT_FUNC PyInit__locale(void);
+PyMODINIT_FUNC PyInit__io(void);
+PyMODINIT_FUNC PyInit_zipimport(void);
+PyMODINIT_FUNC PyInit_faulthandler(void);
+PyMODINIT_FUNC PyInit__tracemalloc(void);
+PyMODINIT_FUNC PyInit__symtable(void);
+PyMODINIT_FUNC PyInit_xxsubtype(void);
+
+/* -- ADDMODULE MARKER 1 -- */
+
+PyMODINIT_FUNC PyMarshal_Init(void);
+PyMODINIT_FUNC PyInit__imp(void);
+PyMODINIT_FUNC PyInit_gc(void);
+PyMODINIT_FUNC PyInit__ast(void);
+PyMODINIT_FUNC _PyWarnings_Init(void);
+PyMODINIT_FUNC PyInit__string(void);
+
+/* Distribution standard modules -- auto generated from make.log */
+/* Standard distribution modules, embedded for iOS */
+PyMODINIT_FUNC PyInit__struct(void);
+PyMODINIT_FUNC PyInit__ctypes_test(void);
+PyMODINIT_FUNC PyInit_array(void);
+PyMODINIT_FUNC PyInit__contextvars(void);
+PyMODINIT_FUNC PyInit_cmath(void);
+PyMODINIT_FUNC PyInit_math(void);
+PyMODINIT_FUNC PyInit__datetime(void);
+PyMODINIT_FUNC PyInit__random(void);
+PyMODINIT_FUNC PyInit__bisect(void);
+PyMODINIT_FUNC PyInit__heapq(void);
+PyMODINIT_FUNC PyInit__pickle(void);
+PyMODINIT_FUNC PyInit__json(void);
+PyMODINIT_FUNC PyInit__testcapi(void);
+PyMODINIT_FUNC PyInit__testbuffer(void);
+PyMODINIT_FUNC PyInit__testimportmultiple(void);
+PyMODINIT_FUNC PyInit__testmultiphase(void);
+PyMODINIT_FUNC PyInit__lsprof(void);
+PyMODINIT_FUNC PyInit_unicodedata(void);
+PyMODINIT_FUNC PyInit__opcode(void);
+PyMODINIT_FUNC PyInit__asyncio(void);
+PyMODINIT_FUNC PyInit__queue(void);
+PyMODINIT_FUNC PyInit_fcntl(void);
+PyMODINIT_FUNC PyInit_grp(void);
+PyMODINIT_FUNC PyInit_select(void);
+PyMODINIT_FUNC PyInit_parser(void);
+PyMODINIT_FUNC PyInit_mmap(void);
+PyMODINIT_FUNC PyInit_syslog(void);
+PyMODINIT_FUNC PyInit__xxtestfuzz(void);
+PyMODINIT_FUNC PyInit_audioop(void);
+// PyMODINIT_FUNC PyInit_readline(void); // not compatible with AppStore
+PyMODINIT_FUNC PyInit__crypt(void);
+PyMODINIT_FUNC PyInit__csv(void);
+PyMODINIT_FUNC PyInit__posixsubprocess(void);
+PyMODINIT_FUNC PyInit__socket(void);
+PyMODINIT_FUNC PyInit__ssl(void);
+PyMODINIT_FUNC PyInit__hashlib(void);
+PyMODINIT_FUNC PyInit__sha256(void);
+PyMODINIT_FUNC PyInit__sha512(void);
+PyMODINIT_FUNC PyInit__md5(void);
+PyMODINIT_FUNC PyInit__sha1(void);