Skip to content

Commit b7f1a2e

Browse files
committed
PEP 489: Fix syntax highlighting
1 parent 4a957d1 commit b7f1a2e

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

peps/pep-0489.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Python-Version: 3.5
1212
Post-History: 23-Aug-2013, 20-Feb-2015, 16-Apr-2015, 07-May-2015, 18-May-2015
1313
Resolution: https://mail.python.org/pipermail/python-dev/2015-May/140108.html
1414

15+
.. highlight:: c
1516

1617
Abstract
1718
========
@@ -190,7 +191,7 @@ The framework that calls the importers is explained in
190191

191192
importlib/_bootstrap.py:
192193

193-
::
194+
.. code-block:: python
194195
195196
class BuiltinImporter:
196197
def create_module(self, spec):
@@ -205,7 +206,7 @@ importlib/_bootstrap.py:
205206
206207
importlib/_bootstrap_external.py:
207208

208-
::
209+
.. code-block:: python
209210
210211
class ExtensionFileLoader:
211212
def create_module(self, spec):
@@ -220,7 +221,7 @@ importlib/_bootstrap_external.py:
220221
221222
Python/import.c (the _imp module):
222223

223-
::
224+
.. code-block:: python
224225
225226
def create_dynamic(spec):
226227
name = spec.name
@@ -269,7 +270,7 @@ Python/import.c (the _imp module):
269270
270271
Python/importdl.c:
271272

272-
::
273+
.. code-block:: python
273274
274275
def _PyImport_LoadDynamicModuleWithSpec(spec):
275276
path = spec.origin
@@ -294,7 +295,7 @@ Python/importdl.c:
294295
295296
Objects/moduleobject.c:
296297

297-
::
298+
.. code-block:: python
298299
299300
def PyModule_FromDefAndSpec(def, spec):
300301
name = spec.name
@@ -621,14 +622,16 @@ PyInitU_<encodedname>, where the name is encoded using CPython's
621622
with hyphens ("-") replaced by underscores ("_").
622623

623624

624-
In Python::
625+
In Python:
625626

626-
def export_hook_name(name):
627-
try:
628-
suffix = b'_' + name.encode('ascii')
629-
except UnicodeEncodeError:
630-
suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')
631-
return b'PyInit' + suffix
627+
.. code-block:: python
628+
629+
def export_hook_name(name):
630+
try:
631+
suffix = b'_' + name.encode('ascii')
632+
except UnicodeEncodeError:
633+
suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')
634+
return b'PyInit' + suffix
632635
633636
Examples:
634637

@@ -673,7 +676,9 @@ Note that this mechanism can currently only be used to *load* extra modules,
673676
but not to *find* them. (This is a limitation of the loader mechanism,
674677
which this PEP does not try to modify.)
675678
To work around the lack of a suitable finder, code like the following
676-
can be used::
679+
can be used:
680+
681+
.. code-block:: python
677682
678683
import importlib.machinery
679684
import importlib.util

0 commit comments

Comments
 (0)