| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,6 +160,18 @@ complete listing. | |||
| 160 | 160 | ||
| 161 | 161 | .. versionadded:: 3.4 | |
| 162 | 162 | ||
| 163 | + .. c:macro:: Py_DEPRECATED(version) | ||
| 164 | + | ||
| 165 | + Use this for deprecated declarations. The macro must be placed before the | ||
| 166 | + symbol name. | ||
| 167 | + | ||
| 168 | + Example:: | ||
| 169 | + | ||
| 170 | + Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void); | ||
| 171 | + | ||
| 172 | + .. versionchanged:: 3.8 | ||
| 173 | + MSVC support was added. | ||
| 174 | + | ||
| 163 | 175 | ||
| 164 | 176 | .. _api-objects: | |
| 165 | 177 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1240,6 +1240,15 @@ Changes in the C API | |||
| 1240 | 1240 | ||
| 1241 | 1241 | (Contributed by Eddie Elizondo in :issue:`35810`.) | |
| 1242 | 1242 | ||
| 1243 | + * The :c:macro:`Py_DEPRECATED()` macro has been implemented for MSVC. | ||
| 1244 | + The macro now must be placed before the symbol name. | ||
| 1245 | + | ||
| 1246 | + Example:: | ||
| 1247 | + | ||
| 1248 | + Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void); | ||
| 1249 | + | ||
| 1250 | + (Contributed by Zackery Spytz in :issue:`33407`.) | ||
| 1251 | + | ||
| 1243 | 1252 | ||
| 1244 | 1253 | CPython bytecode changes | |
| 1245 | 1254 | ------------------------ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -316,39 +316,38 @@ PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key); | |||
| 316 | 316 | ||
| 317 | 317 | Return 0 on success. buffer and buffer_len are only set in case no error | |
| 318 | 318 | occurs. Otherwise, -1 is returned and an exception set. */ | |
| 319 | + Py_DEPRECATED(3.0) | ||
| 319 | 320 | PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj, | |
| 320 | 321 | const char **buffer, | |
| 321 | - Py_ssize_t *buffer_len) | ||
| 322 | - Py_DEPRECATED(3.0); | ||
| 322 | + Py_ssize_t *buffer_len); | ||
| 323 | 323 | ||
| 324 | 324 | /* Checks whether an arbitrary object supports the (character, single segment) | |
| 325 | 325 | buffer interface. | |
| 326 | 326 | ||
| 327 | 327 | Returns 1 on success, 0 on failure. */ | |
| 328 | - PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj) | ||
| 329 | - Py_DEPRECATED(3.0); | ||
| 328 | + Py_DEPRECATED(3.0) PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj); | ||
| 330 | 329 | ||
| 331 | 330 | /* Same as PyObject_AsCharBuffer() except that this API expects (readable, | |
| 332 | 331 | single segment) buffer interface and returns a pointer to a read-only memory | |
| 333 | 332 | location which can contain arbitrary data. | |
| 334 | 333 | ||
| 335 | 334 | 0 is returned on success. buffer and buffer_len are only set in case no | |
| 336 | 335 | error occurs. Otherwise, -1 is returned and an exception set. */ | |
| 336 | + Py_DEPRECATED(3.0) | ||
| 337 | 337 | PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj, | |
| 338 | 338 | const void **buffer, | |
| 339 | - Py_ssize_t *buffer_len) | ||
| 340 | - Py_DEPRECATED(3.0); | ||
| 339 | + Py_ssize_t *buffer_len); | ||
| 341 | 340 | ||
| 342 | 341 | /* Takes an arbitrary object which must support the (writable, single segment) | |
| 343 | 342 | buffer interface and returns a pointer to a writable memory location in | |
| 344 | 343 | buffer of size 'buffer_len'. | |
| 345 | 344 | ||
| 346 | 345 | Return 0 on success. buffer and buffer_len are only set in case no error | |
| 347 | 346 | occurs. Otherwise, -1 is returned and an exception set. */ | |
| 347 | + Py_DEPRECATED(3.0) | ||
| 348 | 348 | PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj, | |
| 349 | 349 | void **buffer, | |
| 350 | - Py_ssize_t *buffer_len) | ||
| 351 | - Py_DEPRECATED(3.0); | ||
| 350 | + Py_ssize_t *buffer_len); | ||
| 352 | 351 | ||
| 353 | 352 | ||
| 354 | 353 | /* === New Buffer API ============================================ */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -189,8 +189,8 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *); | |||
| 189 | 189 | ||
| 190 | 190 | PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); | |
| 191 | 191 | PyAPI_FUNC(void) PyEval_InitThreads(void); | |
| 192 | - PyAPI_FUNC(void) PyEval_AcquireLock(void) Py_DEPRECATED(3.2); | ||
| 193 | - PyAPI_FUNC(void) PyEval_ReleaseLock(void) /* Py_DEPRECATED(3.2) */; | ||
| 192 | + Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_AcquireLock(void); | ||
| 193 | + /* Py_DEPRECATED(3.2) */ PyAPI_FUNC(void) PyEval_ReleaseLock(void); | ||
| 194 | 194 | PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate); | |
| 195 | 195 | PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate); | |
| 196 | 196 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,8 +88,9 @@ PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); | |||
| 88 | 88 | /* Convenience functions */ | |
| 89 | 89 | ||
| 90 | 90 | #ifdef MS_WINDOWS | |
| 91 | + Py_DEPRECATED(3.3) | ||
| 91 | 92 | PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( | |
| 92 | - PyObject *, const Py_UNICODE *) Py_DEPRECATED(3.3); | ||
| 93 | + PyObject *, const Py_UNICODE *); | ||
| 93 | 94 | #endif /* MS_WINDOWS */ | |
| 94 | 95 | ||
| 95 | 96 | /* Like PyErr_Format(), but saves current exception as __context__ and | |
@@ -103,11 +104,12 @@ PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause( | |||
| 103 | 104 | ||
| 104 | 105 | #ifdef MS_WINDOWS | |
| 105 | 106 | /* XXX redeclare to use WSTRING */ | |
| 107 | + Py_DEPRECATED(3.3) | ||
| 106 | 108 | PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( | |
| 107 | - int, const Py_UNICODE *) Py_DEPRECATED(3.3); | ||
| 108 | - | ||
| 109 | + int, const Py_UNICODE *); | ||
| 110 | + Py_DEPRECATED(3.3) | ||
| 109 | 111 | PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( | |
| 110 | - PyObject *,int, const Py_UNICODE *) Py_DEPRECATED(3.3); | ||
| 112 | + PyObject *,int, const Py_UNICODE *); | ||
| 111 | 113 | #endif | |
| 112 | 114 | ||
| 113 | 115 | /* In exceptions.c */ | |
@@ -147,23 +149,23 @@ PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( | |||
| 147 | 149 | int lineno); | |
| 148 | 150 | ||
| 149 | 151 | /* Create a UnicodeEncodeError object */ | |
| 150 | - PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( | ||
| 152 | + Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( | ||
| 151 | 153 | const char *encoding, /* UTF-8 encoded string */ | |
| 152 | 154 | const Py_UNICODE *object, | |
| 153 | 155 | Py_ssize_t length, | |
| 154 | 156 | Py_ssize_t start, | |
| 155 | 157 | Py_ssize_t end, | |
| 156 | 158 | const char *reason /* UTF-8 encoded string */ | |
| 157 | - ) Py_DEPRECATED(3.3); | ||
| 159 | + ); | ||
| 158 | 160 | ||
| 159 | 161 | /* Create a UnicodeTranslateError object */ | |
| 160 | - PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( | ||
| 162 | + Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( | ||
| 161 | 163 | const Py_UNICODE *object, | |
| 162 | 164 | Py_ssize_t length, | |
| 163 | 165 | Py_ssize_t start, | |
| 164 | 166 | Py_ssize_t end, | |
| 165 | 167 | const char *reason /* UTF-8 encoded string */ | |
| 166 | - ) Py_DEPRECATED(3.3); | ||
| 168 | + ); | ||
| 167 | 169 | PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( | |
| 168 | 170 | PyObject *object, | |
| 169 | 171 | Py_ssize_t start, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments