diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/multiprocessing/queues.py | 2 | ||||
-rw-r--r-- | Lib/os.py | 6 | ||||
-rwxr-xr-x | Lib/symbol.py | 2 | ||||
-rw-r--r-- | Lib/test/test_generators.py | 2 | ||||
-rw-r--r-- | Lib/test/test_genexps.py | 2 | ||||
-rw-r--r-- | Lib/test/test_syntax.py | 6 |
6 files changed, 8 insertions, 12 deletions
diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index a3393d45854..bbaf6d5550f 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -109,7 +109,7 @@ class Queue(object): self._rlock.release() def qsize(self): - # Raises NotImplementError on Mac OSX because of broken sem_getvalue() + # Raises NotImplementedError on Mac OSX because of broken sem_getvalue() return self._maxsize - self._sem._semlock._get_value() def empty(self): diff --git a/Lib/os.py b/Lib/os.py index 65f88ba1892..5dce0c1f24d 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -437,11 +437,7 @@ def getenv(key, default=None): __all__.append("getenv") def _exists(name): - try: - eval(name) - return True - except NameError: - return False + return name in globals() # Supply spawn*() (probably only for Unix) if _exists("fork") and not _exists("spawnv") and _exists("execv"): diff --git a/Lib/symbol.py b/Lib/symbol.py index 1b773d05de5..4b4c2198632 100755 --- a/Lib/symbol.py +++ b/Lib/symbol.py @@ -52,7 +52,7 @@ while_stmt = 294 for_stmt = 295 try_stmt = 296 with_stmt = 297 -with_var = 298 +with_item = 298 except_clause = 299 suite = 300 test = 301 diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 9b4e3428aff..84028e85386 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1584,7 +1584,7 @@ SyntaxError: can't assign to yield expression >>> def f(): (yield bar) += y Traceback (most recent call last): ... -SyntaxError: augmented assignment to yield expression not possible +SyntaxError: can't assign to yield expression Now check some throw() conditions: diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index 61e9fe5e70a..1f46af13e34 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -142,7 +142,7 @@ Verify that syntax error's are raised for genexps used as lvalues >>> (y for y in (1,2)) += 10 Traceback (most recent call last): ... - SyntaxError: augmented assignment to generator expression not possible + SyntaxError: can't assign to generator expression ########### Tests borrowed from or inspired by test_generators.py ############ diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index c82787e5486..c55171a7210 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -222,17 +222,17 @@ Traceback (most recent call last): SyntaxError: keyword can't be an expression -From ast_for_expr_stmt(): +More set_context(): >>> (x for x in x) += 1 Traceback (most recent call last): -SyntaxError: augmented assignment to generator expression not possible +SyntaxError: can't assign to generator expression >>> None += 1 Traceback (most recent call last): SyntaxError: assignment to keyword >>> f() += 1 Traceback (most recent call last): -SyntaxError: illegal expression for augmented assignment +SyntaxError: can't assign to function call Test continue in finally in weird combinations. |