Skip to content

Commit 8c8ab9e

Browse files
committed
Use relative pathnames for all banners
1 parent c3238b8 commit 8c8ab9e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

autogen/generator.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,34 @@
2121
from .doc import get_rest_doc
2222

2323

24-
gen_banner = '''# This file is auto-generated by {}
24+
autogen_top = "# This file is auto-generated by {}\n".format(
25+
os.path.relpath(__file__))
2526

27+
gen_banner = autogen_top + '''
2628
cdef class Gen_auto:
2729
"""
2830
Part of the :class:`Gen` class containing auto-generated functions.
2931
3032
This class is not meant to be used directly, use the derived class
3133
:class:`Gen` instead.
3234
"""
33-
'''.format(os.path.relpath(__file__, os.getcwd()))
34-
35-
instance_banner = '''# This file is auto-generated by {}
35+
'''
3636

37+
instance_banner = autogen_top + '''
3738
cdef class Pari_auto:
3839
"""
3940
Part of the :class:`Pari` class containing auto-generated functions.
4041
4142
You must never use this class directly (in fact, Python may crash
4243
if you do), use the derived class :class:`Pari` instead.
4344
"""
44-
'''.format(os.path.relpath(__file__, os.getcwd()))
45-
46-
decl_banner='''# This file is auto-generated by {}
45+
'''
4746

47+
decl_banner = autogen_top + '''
4848
from .types cimport *
4949
5050
cdef extern from *:
51-
'''.format(__file__)
51+
'''
5252

5353

5454
function_re = re.compile(r"^[A-Za-z][A-Za-z0-9_]*$")

0 commit comments

Comments
 (0)