Kaydet (Commit) a79e33e0 authored tarafından Alexandre Vassalotti's avatar Alexandre Vassalotti

Merged revisions…

Merged revisions 62954-62959,62961,62963-62967,62969-62970,62972-62973,62975-62976,62978-62982,62984,62987-62996 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r62954 | martin.v.loewis | 2008-05-09 16:11:37 -0400 (Fri, 09 May 2008) | 1 line

  Port to VS 2008. Drop W9x support.
........
  r62957 | benjamin.peterson | 2008-05-09 17:30:26 -0400 (Fri, 09 May 2008) | 2 lines

  In stdtypes.rst, move methods under class directives where applicable
........
  r62958 | brett.cannon | 2008-05-09 17:30:36 -0400 (Fri, 09 May 2008) | 2 lines

  Add a todo list to the module deletion command.
........
  r62963 | brett.cannon | 2008-05-09 18:52:28 -0400 (Fri, 09 May 2008) | 2 lines

  Add support for extension modules in 3.0 deprection command.
........
  r62967 | brett.cannon | 2008-05-09 22:25:00 -0400 (Fri, 09 May 2008) | 2 lines

  Fix some errors in the deprecation warnings for new and user.
........
  r62975 | brett.cannon | 2008-05-09 22:54:52 -0400 (Fri, 09 May 2008) | 3 lines

  Suppress deprecations for packages as well when using
  test.test_support.import_module().
........
  r62976 | brett.cannon | 2008-05-09 22:57:03 -0400 (Fri, 09 May 2008) | 2 lines

  Also ignore package deprecations.
........
  r62982 | benjamin.peterson | 2008-05-09 23:08:17 -0400 (Fri, 09 May 2008) | 2 lines

  Add the examples in the json module docstring as a doctest
........
  r62992 | martin.v.loewis | 2008-05-10 09:24:09 -0400 (Sat, 10 May 2008) | 2 lines

  Explicitly refer to current hhp file (2.6a3)
........
  r62993 | skip.montanaro | 2008-05-10 10:48:49 -0400 (Sat, 10 May 2008) | 2 lines

  Note the PyPI-edness of bsddb185 for people who might still need it.
........
  r62994 | andrew.kuchling | 2008-05-10 13:36:24 -0400 (Sat, 10 May 2008) | 1 line

  Docstring typo
........
  r62995 | andrew.kuchling | 2008-05-10 13:37:05 -0400 (Sat, 10 May 2008) | 1 line

  Document the 'line' argument
........
  r62996 | andrew.kuchling | 2008-05-10 13:48:45 -0400 (Sat, 10 May 2008) | 1 line

  #1625509: describe behaviour of import lock
........
üst 6461e101
......@@ -112,10 +112,16 @@ This module provides an interface to the mechanisms used to implement the
.. function:: acquire_lock()
Acquires the interpreter's import lock for the current thread. This lock should
Acquire the interpreter's import lock for the current thread. This lock should
be used by import hooks to ensure thread-safety when importing modules. On
platforms without threads, this function does nothing.
Once a thread has acquired the import lock, the same thread may acquire it
again without blocking; the thread must release it once for each time it has
acquired it.
On platforms without threads, this function does nothing.
.. function:: release_lock()
......
This diff is collapsed.
......@@ -209,12 +209,17 @@ Available Functions
resulting string to *file*, which defaults to ``sys.stderr``. You may replace
this function with an alternative implementation by assigning to
``warnings.showwarning``.
*line* is a line of source code to be included in the warning
message; if *line* is not supplied, :func:`showwarning` will
try to read the line specified by *filename* and *lineno*.
.. function:: formatwarning(message, category, filename, lineno[, line])
Format a warning the standard way. This returns a string which may contain
embedded newlines and ends in a newline.
embedded newlines and ends in a newline. *line* is
a line of source code to be included in the warning message; if *line* is not supplied,
:func:`formatwarning` will try to read the line specified by *filename* and *lineno*.
.. function:: filterwarnings(action[, message[, category[, module[, lineno[, append]]]]])
......
......@@ -184,7 +184,7 @@ def addsitedir(sitedir, known_paths=None):
def check_enableusersite():
"""Check if user site directory is safe for inclusion
The functions tests for the command line flag (including environment var),
The function tests for the command line flag (including environment var),
process uid/gid equal to effective uid/gid.
None: Disabled for security reasons
......
......@@ -9,7 +9,8 @@ class AllTest(unittest.TestCase):
def check_all(self, modname):
names = {}
with catch_warning():
warnings.filterwarnings("ignore", ".* module", DeprecationWarning)
warnings.filterwarnings("ignore", ".* (module|package)",
DeprecationWarning)
try:
exec("import %s" % modname, names)
except ImportError:
......
......@@ -11,6 +11,7 @@ import test.test_support
def test_main():
test.test_support.run_unittest(json.tests.test_suite())
test.test_support.run_doctest(json)
if __name__ == "__main__":
......
......@@ -42,7 +42,8 @@ def import_module(name, deprecated=False):
available."""
with catch_warning(record=False):
if deprecated:
warnings.filterwarnings("ignore", ".+ module", DeprecationWarning)
warnings.filterwarnings("ignore", ".+ (module|package)",
DeprecationWarning)
try:
module = __import__(name, level=0)
except ImportError:
......
......@@ -6,24 +6,50 @@
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/python
"""Generate code to warn about a module's removal in Python 3.0.
template = """from warnings import warnpy3k
XXX Not supported:
- Module's in a package do not have their full name generated.
- Package's __init__ module; should detect and use the package's name instead.
"""
py_template = """from warnings import warnpy3k
warnpy3k("the ${1:%s} module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
$0"""
del warnpy3k$0"""
c_template = """
if (PyErr_WarnPy3k("the ${1:%s} module has been removed in "
"Python 3.0", 2) &lt; 0)
return;$0"""
import imp
import os
file_name = os.path.split(os.environ['TM_FILEPATH'])[1]
for suffix in (tuple_[0] for tuple_ in imp.get_suffixes()):
if not file_name.endswith(suffix):
py_suffixes = reversed(sorted((suffix[0] for suffix in imp.get_suffixes() if suffix[2] == imp.PY_SOURCE), key=len))
c_suffixes = reversed(sorted((os.path.splitext(suffix[0])[0] + '.c'
for suffix in imp.get_suffixes() if suffix[2] == imp.C_EXTENSION), key=len))
pairings = ((py_suffixes, py_template), (c_suffixes, c_template))
def create_template(suffixes, template):
for suffix in suffixes:
if not file_name.endswith(suffix):
continue
module_name = file_name[:-len(suffix)]
return template % module_name
else:
return None
for template in (create_template(*pair) for pair in pairings):
if not template:
continue
module_name = file_name[:-len(suffix)]
print (template % module_name),
print template,
break
else:
print (template % "XXX"),</string>
print 'XXX Could not generate code.'</string>
<key>input</key>
<string>none</string>
<key>name</key>
......
......@@ -22,10 +22,12 @@
<string>Python-Dev</string>
<key>ordering</key>
<array>
<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
</array>
<key>uuid</key>
<string>A932ECD1-D43A-4F57-B7FB-A1CEC3B65D20</string>
......
......@@ -9,7 +9,7 @@ vcbuild /useenv PCbuild\pcbuild.sln "Release|Win32"
@rem build the documentation
bash.exe -c 'cd Doc;make PYTHON=python2.5 update htmlhelp'
"%ProgramFiles%\HTML Help Workshop\hhc.exe" Doc\build\htmlhelp\pydoc.hhp
"%ProgramFiles%\HTML Help Workshop\hhc.exe" Doc\build\htmlhelp\python30a5.hhp
@rem buold the MSI file
cd PC
......
#include "windows.h"
#include "msiquery.h"
int isWinNT;
/* Print a debug message to the installer log file.
* To see the debug messages, install with
* msiexec /i pythonxy.msi /l*v python.log
......@@ -30,21 +28,14 @@ UINT __declspec(dllexport) __stdcall CheckDir(MSIHANDLE hInstall)
DWORD size = PSIZE;
DWORD attributes;
isWinNT = (GetVersion() < 0x80000000) ? 1 : 0;
if (isWinNT)
result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
else
result = MsiGetPropertyA(hInstall, "TARGETDIR", path, &size);
result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
if (result != ERROR_SUCCESS)
return result;
wpath[size] = L'\0';
path[size] = L'\0';
if (isWinNT)
attributes = GetFileAttributesW(wpath);
else
attributes = GetFileAttributesA(path);
attributes = GetFileAttributesW(wpath);
if (attributes == INVALID_FILE_ATTRIBUTES ||
!(attributes & FILE_ATTRIBUTE_DIRECTORY))
{
......
!IF "$(CPU)" == ""
# VS environment
# /OPT: REF and ICF are added by VS.NET by default
# NOWIN98 saves 7k of executable size, at the expense of some
# slowdown on Win98
msisupport.dll: msisupport.obj
link.exe /OUT:msisupport.dll /INCREMENTAL:NO /NOLOGO /DLL /MACHINE:X86 /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /OPT:NOWIN98 msisupport.obj msi.lib kernel32.lib
link.exe /OUT:msisupport.dll /INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF msisupport.obj msi.lib kernel32.lib
# We request a static CRT, so that there will be no CRT dependencies
# for the target system. We cannot do without a CRT, since it provides
# the DLL entry point.
msisupport.obj: msisupport.c
cl /O2 /D WIN32 /D NDEBUG /D _WINDOWS /MT /W3 /c msisupport.c
!ELSE
# SDK environment: assume all options are already correct
msisupport.dll: msisupport.obj
link.exe /OUT:msisupport.dll /INCREMENTAL:NO /NOLOGO /DLL msisupport.obj msi.lib kernel32.lib
msisupport.obj: msisupport.c
cl /O2 /D WIN32 /D NDEBUG /D _WINDOWS /MD /W3 /GS- /c msisupport.c
!ENDIF
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