Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ac0f8f

Browse files
committed
Merge remote-tracking branch 'upstream/3.10' into 3.10
2 parents 0abc6a3 + 75c3a4c commit 6ac0f8f

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

Lib/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ def visit_Import(self, node):
849849

850850
def visit_ImportFrom(self, node):
851851
self.fill("from ")
852-
self.write("." * node.level)
852+
self.write("." * (node.level or 0))
853853
if node.module:
854854
self.write(node.module)
855855
self.write(" import ")

Lib/test/test_unparse.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ def test_invalid_fstring_backslash(self):
341341
def test_invalid_yield_from(self):
342342
self.check_invalid(ast.YieldFrom(value=None))
343343

344+
def test_import_from_level_none(self):
345+
tree = ast.ImportFrom(module='mod', names=[ast.alias(name='x')])
346+
self.assertEqual(ast.unparse(tree), "from mod import x")
347+
tree = ast.ImportFrom(module='mod', names=[ast.alias(name='x')], level=None)
348+
self.assertEqual(ast.unparse(tree), "from mod import x")
349+
344350
def test_docstrings(self):
345351
docstrings = (
346352
'this ends with double quote"',

Mac/BuildScript/build-installer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def library_recipes():
249249
name="OpenSSL 1.1.1q",
250250
url="https://www.openssl.org/source/openssl-1.1.1q.tar.gz",
251251
checksum='d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca',
252+
patches=['openssl1.1.1q-pr-18719.patch'],
252253
buildrecipe=build_universal_openssl,
253254
configure=None,
254255
install=None,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
https://github.com/openssl/openssl/commit/60f011f584d80447e86cae1d1bd3ae24bc13235b
2+
This fixes a regression in 1.1.1q:
3+
4+
test/v3ext.c:201:24: error: implicitly declaring library function 'memcmp' with type 'int (const void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
5+
if (!TEST_true(memcmp(ip1->data, ip2->data, ip1->length) <= 0))
6+
7+
diff -Naur openssl-1.1.1q/test/v3ext.c openssl-1.1.1q-patched/test/v3ext.c
8+
--- openssl-1.1.1q/test/v3ext.c 2022-07-05 09:08:33.000000000 +0000
9+
+++ openssl-1.1.1q-patched/test/v3ext.c 2022-09-05 16:54:45.740859256 +0000
10+
@@ -8,6 +8,7 @@
11+
*/
12+
13+
#include <stdio.h>
14+
+#include <string.h>
15+
#include <openssl/x509.h>
16+
#include <openssl/x509v3.h>
17+
#include <openssl/pem.h>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix :func:`ast.unparse` when ``ImportFrom.level`` is None

0 commit comments

Comments
 (0)