Kaydet (Commit) 0e6d2131 authored tarafından Tim Peters's avatar Tim Peters

Whitespace normalization.

üst b61ff298
...@@ -81,7 +81,7 @@ __all__ = ["Random","seed","random","uniform","randint","choice", ...@@ -81,7 +81,7 @@ __all__ = ["Random","seed","random","uniform","randint","choice",
"cunifvariate","expovariate","vonmisesvariate","gammavariate", "cunifvariate","expovariate","vonmisesvariate","gammavariate",
"stdgamma","gauss","betavariate","paretovariate","weibullvariate", "stdgamma","gauss","betavariate","paretovariate","weibullvariate",
"getstate","setstate","jumpahead","whseed"] "getstate","setstate","jumpahead","whseed"]
def _verify(name, expected): def _verify(name, expected):
computed = eval(name) computed = eval(name)
if abs(computed - expected) > 1e-7: if abs(computed - expected) > 1e-7:
......
...@@ -201,7 +201,7 @@ class URLopener(urllib.FancyURLopener): ...@@ -201,7 +201,7 @@ class URLopener(urllib.FancyURLopener):
self.errcode = 200 self.errcode = 200
self.tries = 0 self.tries = 0
self.maxtries = 10 self.maxtries = 10
def http_error_default(self, url, fp, errcode, errmsg, headers): def http_error_default(self, url, fp, errcode, errmsg, headers):
self.errcode = errcode self.errcode = errcode
return urllib.FancyURLopener.http_error_default(self, url, fp, errcode, return urllib.FancyURLopener.http_error_default(self, url, fp, errcode,
......
...@@ -207,7 +207,7 @@ check_syntax("""def unoptimized_clash2(): ...@@ -207,7 +207,7 @@ check_syntax("""def unoptimized_clash2():
return f return f
""") """)
# XXX could allow this for exec with const argument, but what's the point # XXX could allow this for exec with const argument, but what's the point
check_syntax("""def error(y): check_syntax("""def error(y):
exec "a = 1" exec "a = 1"
def f(x): def f(x):
...@@ -225,7 +225,7 @@ check_syntax("""def f(): ...@@ -225,7 +225,7 @@ check_syntax("""def f():
def g(): def g():
from string import * from string import *
return strip # global or local? return strip # global or local?
""") """)
# and verify a few cases that should work # and verify a few cases that should work
...@@ -302,9 +302,9 @@ def makeReturner(*lst): ...@@ -302,9 +302,9 @@ def makeReturner(*lst):
def returner(): def returner():
return lst return lst
return returner return returner
verify(makeReturner(1,2,3)() == (1,2,3)) verify(makeReturner(1,2,3)() == (1,2,3))
def makeReturner2(**kwargs): def makeReturner2(**kwargs):
def returner(): def returner():
return kwargs return kwargs
......
...@@ -6,4 +6,3 @@ symbols = _symtable.symtable("def f(x): return x", "?", "exec") ...@@ -6,4 +6,3 @@ symbols = _symtable.symtable("def f(x): return x", "?", "exec")
verify(symbols[0].name == "global") verify(symbols[0].name == "global")
verify(len([ste for ste in symbols.values() if ste.name == "f"]) == 1) verify(len([ste for ste in symbols.values() if ste.name == "f"]) == 1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment