Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b35ffc04
Kaydet (Commit)
b35ffc04
authored
Ock 15, 2001
tarafından
Fredrik Lundh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches
üst
142297ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
sre_compile.py
Lib/sre_compile.py
+2
-0
sre_constants.py
Lib/sre_constants.py
+9
-0
_sre.c
Modules/_sre.c
+9
-1
sre_constants.h
Modules/sre_constants.h
+1
-0
No files found.
Lib/sre_compile.py
Dosyayı görüntüle @
b35ffc04
...
@@ -12,6 +12,8 @@ import _sre
...
@@ -12,6 +12,8 @@ import _sre
from
sre_constants
import
*
from
sre_constants
import
*
assert
_sre
.
MAGIC
==
MAGIC
,
"SRE module mismatch"
MAXCODE
=
65535
MAXCODE
=
65535
def
_compile
(
code
,
pattern
,
flags
):
def
_compile
(
code
,
pattern
,
flags
):
...
...
Lib/sre_constants.py
Dosyayı görüntüle @
b35ffc04
...
@@ -9,8 +9,15 @@
...
@@ -9,8 +9,15 @@
# See the sre.py file for information on usage and redistribution.
# See the sre.py file for information on usage and redistribution.
#
#
# update when constants are added or removed
MAGIC
=
20010115
# max code word in this release
MAXREPEAT
=
65535
MAXREPEAT
=
65535
# SRE standard exception (access as sre.error)
# should this really be here?
# should this really be here?
class
error
(
Exception
):
class
error
(
Exception
):
...
@@ -211,6 +218,8 @@ if __name__ == "__main__":
...
@@ -211,6 +218,8 @@ if __name__ == "__main__":
"""
)
"""
)
f
.
write
(
"#define SRE_MAGIC
%
d
\n
"
%
MAGIC
)
dump
(
f
,
OPCODES
,
"SRE_OP"
)
dump
(
f
,
OPCODES
,
"SRE_OP"
)
dump
(
f
,
ATCODES
,
"SRE"
)
dump
(
f
,
ATCODES
,
"SRE"
)
dump
(
f
,
CHCODES
,
"SRE"
)
dump
(
f
,
CHCODES
,
"SRE"
)
...
...
Modules/_sre.c
Dosyayı görüntüle @
b35ffc04
...
@@ -2355,11 +2355,19 @@ __declspec(dllexport)
...
@@ -2355,11 +2355,19 @@ __declspec(dllexport)
#endif
#endif
init_sre
(
void
)
init_sre
(
void
)
{
{
PyObject
*
m
;
PyObject
*
d
;
/* Patch object types */
/* Patch object types */
Pattern_Type
.
ob_type
=
Match_Type
.
ob_type
=
Pattern_Type
.
ob_type
=
Match_Type
.
ob_type
=
Scanner_Type
.
ob_type
=
&
PyType_Type
;
Scanner_Type
.
ob_type
=
&
PyType_Type
;
Py_InitModule
(
"_"
MODULE
,
_functions
);
m
=
Py_InitModule
(
"_"
MODULE
,
_functions
);
d
=
PyModule_GetDict
(
m
);
PyDict_SetItemString
(
d
,
"MAGIC"
,
(
PyObject
*
)
PyInt_FromLong
(
SRE_MAGIC
)
);
}
}
#endif
/* !defined(SRE_RECURSIVE) */
#endif
/* !defined(SRE_RECURSIVE) */
Modules/sre_constants.h
Dosyayı görüntüle @
b35ffc04
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
* See the _sre.c file for information on usage and redistribution.
* See the _sre.c file for information on usage and redistribution.
*/
*/
#define SRE_MAGIC 20010115
#define SRE_OP_FAILURE 0
#define SRE_OP_FAILURE 0
#define SRE_OP_SUCCESS 1
#define SRE_OP_SUCCESS 1
#define SRE_OP_ANY 2
#define SRE_OP_ANY 2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment