GeezerVison is showing github.com — Merged revisions 67028,67040,67044,67046,67052,67065,67070,67077,6708… · Maddie-Code-Collab/cpython@c0747cf
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Doc/ACKS.txt +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | * A. Amoroso | 17 | 17 | * Pehr Anderson | 18 | 18 | * Oliver Andrich | | 19 | + * Heidi Annexstad | 19 | 20 | * Jesús Cea Avión | 20 | 21 | * Daniel Barclay | 21 | 22 | * Chris Barker | |
Collapse file Copy file name to clipboardExpand all lines: Include/compile.h -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -32,8 +32,6 @@ PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *, | 32 | 32 | PyCompilerFlags *, PyArena *); | 33 | 33 | PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); | 34 | 34 |
| 35 | | -#define ERR_LATE_FUTURE \ | 36 | | -"from __future__ imports must occur at the beginning of the file" | 37 | 35 |
| 38 | 36 | #ifdef __cplusplus | 39 | 37 | } | |
Collapse file Copy file name to clipboardExpand all lines: Lib/modulefinder.py +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -310,7 +310,10 @@ def load_module(self, fqname, fp, pathname, file_info): | 310 | 310 | def _add_badmodule(self, name, caller): | 311 | 311 | if name not in self.badmodules: | 312 | 312 | self.badmodules[name] = {} | 313 | | - self.badmodules[name][caller.__name__] = 1 | | 313 | + if caller: | | 314 | + self.badmodules[name][caller.__name__] = 1 | | 315 | + else: | | 316 | + self.badmodules[name]["-"] = 1 | 314 | 317 |
| 315 | 318 | def _safe_import_hook(self, name, caller, fromlist, level=-1): | 316 | 319 | # wrapper for self.import_hook() that won't raise ImportError | |
Collapse file Copy file name to clipboardExpand all lines: Lib/test/test_descr.py +3-7Lines changed: 3 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1020,14 +1020,10 @@ def __init__(self): | 1020 | 1020 | def __del__(self_): | 1021 | 1021 | self.assertEqual(self_.a, 1) | 1022 | 1022 | self.assertEqual(self_.b, 2) | 1023 | | - | 1024 | | - save_stderr = sys.stderr | 1025 | | - sys.stderr = sys.stdout | 1026 | | - h = H() | 1027 | | - try: | | 1023 | + with test_support.captured_output('stderr') as s: | | 1024 | + h = H() | 1028 | 1025 | del h | 1029 | | - finally: | 1030 | | - sys.stderr = save_stderr | | 1026 | + self.assertEqual(s.getvalue(), '') | 1031 | 1027 |
| 1032 | 1028 | def test_slots_special(self): | 1033 | 1029 | # Testing __dict__ and __weakref__ in __slots__... | |
Collapse file Copy file name to clipboardExpand all lines: Lib/test/test_io.py +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1245,6 +1245,7 @@ def test_fileio_warnings(self): | 1245 | 1245 | self.assertRaises(ValueError, io.FileIO, "/some/invalid/name", "rt") | 1246 | 1246 | self.assertEqual(w.warnings, []) | 1247 | 1247 |
| | 1248 | + | 1248 | 1249 | def test_main(): | 1249 | 1250 | support.run_unittest(IOTest, BytesIOTest, StringIOTest, | 1250 | 1251 | BufferedReaderTest, BufferedWriterTest, | |
Collapse file Copy file name to clipboardExpand all lines: Lib/test/test_modulefinder.py +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 190 | 190 | a/b/c/f.py | 191 | 191 | """] | 192 | 192 |
| | 193 | +relative_import_test_3 = [ | | 194 | + "a.module", | | 195 | + ["a", "a.module"], | | 196 | + ["a.bar"], | | 197 | + [], | | 198 | + """\ | | 199 | +a/__init__.py | | 200 | + def foo(): pass | | 201 | +a/module.py | | 202 | + from . import foo | | 203 | + from . import bar | | 204 | +"""] | | 205 | + | 193 | 206 | def open_file(path): | 194 | 207 | ##print "#", os.path.abspath(path) | 195 | 208 | dirname = os.path.dirname(path) | @@ -256,6 +269,9 @@ def test_relative_imports(self): | 256 | 269 | def test_relative_imports_2(self): | 257 | 270 | self._do_test(relative_import_test_2) | 258 | 271 |
| | 272 | + def test_relative_imports_3(self): | | 273 | + self._do_test(relative_import_test_3) | | 274 | + | 259 | 275 | def test_main(): | 260 | 276 | distutils.log.set_threshold(distutils.log.WARN) | 261 | 277 | support.run_unittest(ModuleFinderTest) | |
Collapse file Copy file name to clipboardExpand all lines: Lib/test/test_parser.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import parser | | 2 | +import os | 2 | 3 | import unittest | 3 | 4 | import sys | 4 | 5 | from test import support | @@ -172,6 +173,7 @@ def test_import_from_statement(self): | 172 | 173 | "from sys.path import (dirname, basename as my_basename)") | 173 | 174 | self.check_suite( | 174 | 175 | "from sys.path import (dirname, basename as my_basename,)") | | 176 | + self.check_suite("from .bogus import x") | 175 | 177 |
| 176 | 178 | def test_basic_import_statement(self): | 177 | 179 | self.check_suite("import sys") | |
Collapse file Copy file name to clipboardExpand all lines: Misc/ACKS +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -61,6 +61,7 @@ Eric Beser | 61 | 61 | Steven Bethard | 62 | 62 | Stephen Bevan | 63 | 63 | Ron Bickers | | 64 | +David Binger | 64 | 65 | Dominic Binks | 65 | 66 | Philippe Biondi | 66 | 67 | Stuart Bishop | |
Collapse file Copy file name to clipboardExpand all lines: Modules/_fileio.c +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -251,7 +251,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) | 251 | 251 | self->closefd = 1; | 252 | 252 | if (!closefd) { | 253 | 253 | PyErr_SetString(PyExc_ValueError, | 254 | | - "Cannot use closefd=True with file name"); | | 254 | + "Cannot use closefd=False with file name"); | 255 | 255 | goto error; | 256 | 256 | } | 257 | 257 |
| |
Collapse file Copy file name to clipboardExpand all lines: Modules/parsermodule.c +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1710,10 +1710,10 @@ static int | 1710 | 1710 | count_from_dots(node *tree) | 1711 | 1711 | { | 1712 | 1712 | int i; | 1713 | | - for (i = 0; i < NCH(tree); i++) | | 1713 | + for (i = 1; i < NCH(tree); i++) | 1714 | 1714 | if (TYPE(CHILD(tree, i)) != DOT) | 1715 | 1715 | break; | 1716 | | - return i; | | 1716 | + return i-1; | 1717 | 1717 | } | 1718 | 1718 |
| 1719 | 1719 | /* 'from' ('.'* dotted_name | '.') 'import' ('*' | '(' import_as_names ')' | | |
|