]> granicus.if.org Git - python/commitdiff
Merged revisions 85731,85735 via svnmerge from
authorGeorg Brandl <georg@python.org>
Fri, 26 Nov 2010 07:58:55 +0000 (07:58 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 26 Nov 2010 07:58:55 +0000 (07:58 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85731 | georg.brandl | 2010-10-19 23:07:16 +0200 (Di, 19 Okt 2010) | 1 line

  Be consistent in the spelling of thread-safe(ty).
........
  r85735 | georg.brandl | 2010-10-20 08:50:19 +0200 (Mi, 20 Okt 2010) | 1 line

  Fix r85728: use "" to mean the system default locale, which should work on more systems.
........

Doc/c-api/init.rst
Doc/library/locale.rst
Doc/library/multiprocessing.rst
Doc/library/runpy.rst
Doc/library/threading.rst
Lib/test/test_calendar.py

index d13009fcbd2268d86035d554034c99dc6b3304b8..392a7a9920415b46ae657cf99bcdacd8bc5fed4d 100644 (file)
@@ -418,7 +418,7 @@ Thread State and the Global Interpreter Lock
    single: interpreter lock
    single: lock, interpreter
 
-The Python interpreter is not fully thread safe.  In order to support
+The Python interpreter is not fully thread-safe.  In order to support
 multi-threaded Python programs, there's a global lock, called the :dfn:`global
 interpreter lock` or :dfn:`GIL`, that must be held by the current thread before
 it can safely access Python objects. Without the lock, even the simplest
index 7b4a05f713ac2c6285dc3e57092a1fd223468bce..a668b2d099e5ebecd595e9b6266106436c85bef3 100644 (file)
@@ -40,7 +40,7 @@ The :mod:`locale` module defines the following exception and functions:
    If *locale* is omitted or ``None``, the current setting for *category* is
    returned.
 
-   :func:`setlocale` is not thread safe on most systems. Applications typically
+   :func:`setlocale` is not thread-safe on most systems. Applications typically
    start with a call of ::
 
       import locale
index b49e439ae551004ef6d87c777e5e62c56a573e3f..f4e4a8e57e810106ac06af04ef2a7140c260b66b 100644 (file)
@@ -216,7 +216,7 @@ However, if you really do need to use some shared data then
    The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are
    typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a
    double precision float and ``'i'`` indicates a signed integer.  These shared
-   objects will be process and thread safe.
+   objects will be process and thread-safe.
 
    For more flexibility in using shared memory one can use the
    :mod:`multiprocessing.sharedctypes` module which supports the creation of
index 23d0730e46b26a2301700c364df1712251a6c7c2..905c64b46a7db32ad2563d186c1bc8b9b56bd293 100644 (file)
@@ -120,7 +120,7 @@ The :mod:`runpy` module provides two functions:
 
    Note that, unlike :func:`run_module`, the alterations made to :mod:`sys`
    are not optional in this function as these adjustments are essential to
-   allowing the execution of sys.path entries. As the thread safety
+   allowing the execution of sys.path entries. As the thread-safety
    limitations still apply, use of this function in threaded code should be
    either serialised with the import lock or delegated to a separate process.
 
index b22d3d12e6b2dfe498e6996dcdaa9f13e92414ff..cd3f96369d57f2bdf1ed64156593038e5f4881b3 100644 (file)
@@ -781,9 +781,9 @@ Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`,
 Importing in threaded code
 --------------------------
 
-While the import machinery is thread safe, there are two key
-restrictions on threaded imports due to inherent limitations in the way
-that thread safety is provided:
+While the import machinery is thread-safe, there are two key restrictions on
+threaded imports due to inherent limitations in the way that thread-safety is
+provided:
 
 * Firstly, other than in the main module, an import should not have the
   side effect of spawning a new thread and then waiting for that thread in
index 8396bdf6f56afc341b226de5367013bba0da8718..f20cc03929cb65a9e902c5e28cc7bd7d9d13ec11 100644 (file)
@@ -252,16 +252,13 @@ class CalendarTestCase(unittest.TestCase):
     def test_localecalendars(self):
         # ensure that Locale{Text,HTML}Calendar resets the locale properly
         # (it is still not thread-safe though)
+        old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
         try:
-            def_locale = locale.getdefaultlocale()
+            calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10)
         except locale.Error:
-            # cannot determine a default locale -- skip test
+            # cannot set the system default locale -- skip rest of test
             return
-        old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
-        calendar.LocaleTextCalendar(
-            locale=def_locale).formatmonthname(2010, 10, 10)
-        calendar.LocaleHTMLCalendar(
-            locale=def_locale).formatmonthname(2010, 10)
+        calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10)
         new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
         self.assertEquals(old_october, new_october)