Skip to content

Commit 9c7eab8

Browse files
author
Fredrik Lundh
committed
SRE: made "copyright" string static, to avoid potential linking
conflicts.
1 parent e697091 commit 9c7eab8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Modules/_sre.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* 2001-01-15 fl avoid recursion for MIN_UNTIL; fixed uppercase literal bug
2828
* 2001-01-16 fl fixed memory leak in pattern destructor
2929
* 2001-03-20 fl lots of fixes for 2.1b2
30+
* 2001-04-15 fl export copyright as Python attribute, not global
3031
*
3132
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
3233
*
@@ -41,7 +42,8 @@
4142

4243
#ifndef SRE_RECURSIVE
4344

44-
char copyright[] = " SRE 2.1b2 Copyright (c) 1997-2001 by Secret Labs AB ";
45+
static char copyright[] =
46+
" SRE 2.1b2 Copyright (c) 1997-2001 by Secret Labs AB ";
4547

4648
#include "Python.h"
4749

@@ -2427,6 +2429,11 @@ init_sre(void)
24272429
PyDict_SetItemString(
24282430
d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC)
24292431
);
2432+
2433+
PyDict_SetItemString(
2434+
d, "copyright", (PyObject*) PyString_FromString(copyright)
2435+
);
2436+
24302437
}
24312438

24322439
#endif /* !defined(SRE_RECURSIVE) */

0 commit comments

Comments
 (0)