#ifdef __cplusplus
extern "C" {
#endif
-
+
typedef struct {
PyObject *ptr; /* Cached pointer (borrowed reference) */
uint64_t globals_ver; /* ma_version of global dict */
self.assertEqual(err.end_lineno, end_lineno)
if end_offset is not None:
self.assertEqual(err.end_offset, end_offset)
-
+
else:
self.fail("compile() did not raise SyntaxError")
self._check_error("int(**{'base': 10}, *['2'])",
"iterable argument unpacking follows "
"keyword argument unpacking")
-
+
def test_generator_in_function_call(self):
self._check_error("foo(x, y for y in range(3) for z in range(2) if z , p)",
"Generator expression must be parenthesized",
clock_names = [
"CLOCK_MONOTONIC", "clock_gettime", "clock_gettime_ns", "clock_settime",
"clock_settime_ns", "clock_getres"]
-
+
if mac_ver >= (10, 12):
for name in clock_names:
self.assertTrue(hasattr(time, name), f"time.{name} is not available")
'NamedTuple', # Not really a type.
'TypedDict', # Not really a type.
'Generator',
-
+
# Other concrete types.
'BinaryIO',
'IO',
{
PyObject *result, *key_x;
Py_ssize_t index;
-
+
if (key == Py_None) {
index = internal_bisect_left(a, x, lo, hi, key);
} else {
static struct PyModuleDef_Slot _ctypes_test_slots[] = {
{0, NULL}
-};
+};
static struct PyModuleDef _ctypes_testmodule = {
PyModuleDef_HEAD_INIT,
if (decoder == NULL) {
return;
}
-
+
_Py_IDENTIFIER(JSONDecodeError);
PyObject *JSONDecodeError = _PyObject_GetAttrId(decoder, &PyId_JSONDecodeError);
Py_DECREF(decoder);
termiosmodule_clear((PyObject *)m);
}
-static int
+static int
termios_exec(PyObject *mod)
{
struct constant *constant = termios_constants;
&self->end_lineno, &self->end_offset)) {
Py_DECREF(info);
return -1;
- }
+ }
Py_INCREF(self->filename);
Py_INCREF(self->lineno);
};
/* A helper function to create GenericAlias' args tuple and set its attributes.
- * Returns 1 on success, 0 on failure.
+ * Returns 1 on success, 0 on failure.
*/
static inline int
setup_ga(gaobject *alias, PyObject *origin, PyObject *args) {
fputc('\n', out);
- /* Account for what all of those arena bytes are being used for. */
+ /* Account for what all of those arena bytes are being used for. */
total = printone(out, "# bytes in allocated blocks", allocated_bytes);
total += printone(out, "# bytes in available blocks", available_bytes);
int async_def_nl; /* =1 if the outermost 'async def' had at least one
NEWLINE token after it. */
/* How to proceed when asked for a new token in interactive mode */
- enum interactive_underflow_t interactive_underflow;
+ enum interactive_underflow_t interactive_underflow;
};
extern struct tok_state *PyTokenizer_FromString(const char *, int);
# include <sanitizer/msan_interface.h>
#endif
-#if defined(__APPLE__) && defined(__has_builtin)
+#if defined(__APPLE__) && defined(__has_builtin)
# if __has_builtin(__builtin_available)
# define HAVE_GETENTRYPY_GETRANDOM_RUNTIME __builtin_available(macOS 10.12, iOS 10.10, tvOS 10.0, watchOS 3.0, *)
# endif
#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
static int
-py_getentropy(char *buffer, Py_ssize_t size, int raise)
+py_getentropy(char *buffer, Py_ssize_t size, int raise)
__attribute__((availability(macos,introduced=10.12)))
__attribute__((availability(ios,introduced=10.0)))
__attribute__((availability(tvos,introduced=10.0)))
if isinstance(srclines, str): # a filename
raise NotImplementedError
-
+
# This only handles at most 10 nested levels.
#MATCHED_PARENS = textwrap.dedent(rf'''
macros = list(_resolve_file_values(filename, file_macros))
if file_incldirs:
incldirs = [v for v, in _resolve_file_values(filename, file_incldirs)]
-
+
def preprocess(**kwargs):
if file_macros and 'macros' not in kwargs:
kwargs['macros'] = macros