diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst index 662407a6b3a..549a92286d5 100644 --- a/Doc/tutorial/inputoutput.rst +++ b/Doc/tutorial/inputoutput.rst @@ -152,9 +152,9 @@ Positional and keyword arguments can be arbitrarily combined:: other='Georg')) The story of Bill, Manfred, and Georg. -An optional ``':'`` and format specifier can follow the field name. This also +An optional ``':'`` and format specifier can follow the field name. This allows greater control over how the value is formatted. The following example -truncates the Pi to three places after the decimal. +truncates Pi to three places after the decimal. >>> import math >>> print('The value of PI is approximately {0:.3f}.'.format(math.pi)) @@ -208,8 +208,8 @@ operation. For example:: The value of PI is approximately 3.142. Since :meth:`str.format` is quite new, a lot of Python code still uses the ``%`` -operator. However, because this old style of formatting will eventually removed -from the language :meth:`str.format` should generally be used. +operator. However, because this old style of formatting will eventually be +removed from the language, :meth:`str.format` should generally be used. More information can be found in the :ref:`old-string-formatting` section. diff --git a/Lib/inspect.py b/Lib/inspect.py index 4b3e27a4ca2..79565c14378 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -990,7 +990,10 @@ def getinnerframes(tb, context=1): tb = tb.tb_next return framelist -currentframe = sys._getframe +if hasattr(sys, '_getframe'): + currentframe = sys._getframe +else: + currentframe = lambda _=None: None def stack(context=1): """Return a list of records for the stack above the caller's frame.""" diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index fb227fec8d0..1d9ff4340c9 100644 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -56,7 +56,7 @@ def get(using=None): # It is recommended one does "import webbrowser" and uses webbrowser.open(url) # instead of "from webbrowser import *". -def open(url, new=0, autoraise=1): +def open(url, new=0, autoraise=True): for name in _tryorder: browser = get(name) if browser.open(url, new, autoraise): @@ -145,7 +145,7 @@ class BaseBrowser(object): self.name = name self.basename = name - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): raise NotImplementedError def open_new(self, url): @@ -169,7 +169,7 @@ class GenericBrowser(BaseBrowser): self.args = name[1:] self.basename = os.path.basename(self.name) - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] try: @@ -186,7 +186,7 @@ class BackgroundBrowser(GenericBrowser): """Class for all browsers which are to be started in the background.""" - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] try: @@ -217,7 +217,7 @@ class UnixBrowser(BaseBrowser): raise_opt = [] if remote and self.raise_opts: # use autoraise argument only for remote invocation - autoraise = int(bool(autoraise)) + autoraise = int(autoraise) opt = self.raise_opts[autoraise] if opt: raise_opt = [opt] @@ -257,7 +257,7 @@ class UnixBrowser(BaseBrowser): else: return not p.wait() - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): if new == 0: action = self.remote_action elif new == 1: @@ -341,7 +341,7 @@ class Konqueror(BaseBrowser): for more information on the Konqueror remote-control interface. """ - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): # XXX Currently I know no way to prevent KFM from opening a new win. if new == 2: action = "newTab" @@ -429,7 +429,7 @@ class Grail(BaseBrowser): s.close() return 1 - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): if new: ok = self._remote("LOADNEW " + url) else: @@ -512,7 +512,7 @@ if os.environ.get("TERM"): if sys.platform[:3] == "win": class WindowsDefault(BaseBrowser): - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): try: os.startfile(url) except WindowsError: @@ -546,7 +546,7 @@ except ImportError: pass else: class InternetConfig(BaseBrowser): - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): ic.launchurl(url) return True # Any way to get status? @@ -567,7 +567,7 @@ if sys.platform == 'darwin': def __init__(self, name): self.name = name - def open(self, url, new=0, autoraise=1): + def open(self, url, new=0, autoraise=True): assert "'" not in url # hack for local urls if not ':' in url: diff --git a/Misc/build.sh b/Misc/build.sh index d7d0ea1e493..544fd2910bb 100755 --- a/Misc/build.sh +++ b/Misc/build.sh @@ -4,9 +4,11 @@ ## does this: ## svn up ; ./configure ; make ; make test ; make install ; cd Doc ; make ## -## Logs are kept and rsync'ed to the host. If there are test failure(s), +## Logs are kept and rsync'ed to the webhost. If there are test failure(s), ## information about the failure(s) is mailed. ## +## The user must be a member of the webmaster group locally and on webhost. +## ## This script is run on the PSF's machine as user neal via crontab. ## ## Yes, this script would probably be easier in python, but then @@ -76,7 +78,8 @@ ALWAYS_SKIP="-x $_ALWAYS_SKIP" # Skip these tests altogether when looking for leaks. These tests # do not need to be stored above in LEAKY_TESTS too. # test_logging causes hangs, skip it. -LEAKY_SKIPS="-x test_logging $_ALWAYS_SKIP" +# KBK 21Apr09: test_httpservers causes hangs, skip for now. +LEAKY_SKIPS="-x test_compiler test_logging test_httpservers" # Change this flag to "yes" for old releases to only update/build the docs. BUILD_DISABLED="no" @@ -133,9 +136,14 @@ mail_on_failure() { ## setup cd $DIR +make clobber /dev/null 2>&1 +cp -p Modules/Setup.dist Modules/Setup +# But maybe there was no Makefile - we are only building docs. Clear build: +rm -rf build/ mkdir -p build -rm -f $RESULT_FILE build/*.out rm -rf $INSTALL_DIR +## get the path we are building +repo_path=$(grep "url=" .svn/entries | sed -e s/\\W*url=// -e s/\"//g) ## create results file TITLE="Automated Python Build Results" @@ -153,6 +161,8 @@ echo " " >> $RESULT_FILE echo " Hostname:`uname -n`" >> $RESULT_FILE echo " " >> $RESULT_FILE echo " Platform:`uname -srmpo`" >> $RESULT_FILE +echo " " >> $RESULT_FILE +echo " URL:$repo_path" >> $RESULT_FILE echo " " >> $RESULT_FILE echo "" >> $RESULT_FILE echo "