]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 59864-59882 via svnmerge from
authorChristian Heimes <christian@cheimes.de>
Thu, 10 Jan 2008 00:10:02 +0000 (00:10 +0000)
committerChristian Heimes <christian@cheimes.de>
Thu, 10 Jan 2008 00:10:02 +0000 (00:10 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59866 | raymond.hettinger | 2008-01-09 04:02:23 +0100 (Wed, 09 Jan 2008) | 1 line

  Syntax highlighting only works when >>> lines are accompanied by ... lines
........
  r59867 | fred.drake | 2008-01-09 04:11:28 +0100 (Wed, 09 Jan 2008) | 2 lines

  minor cleaning
........
  r59868 | raymond.hettinger | 2008-01-09 04:13:20 +0100 (Wed, 09 Jan 2008) | 1 line

  Fix typo
........
  r59869 | thomas.heller | 2008-01-09 12:19:19 +0100 (Wed, 09 Jan 2008) | 1 line

  Set the output file in the _ctypes Debug|x64 configuration.
........
  r59870 | andrew.kuchling | 2008-01-09 13:27:41 +0100 (Wed, 09 Jan 2008) | 1 line

  Related to patch #1114: fix another place where attr_t is assumed to be a long
........
  r59873 | christian.heimes | 2008-01-09 15:46:10 +0100 (Wed, 09 Jan 2008) | 1 line

  vs9to8 sync
........
  r59876 | christian.heimes | 2008-01-09 20:56:33 +0100 (Wed, 09 Jan 2008) | 1 line

  Fixed #1776. __import__() no longer imports modules by file name
........
  r59879 | thomas.heller | 2008-01-09 22:35:04 +0100 (Wed, 09 Jan 2008) | 6 lines

  Change amd64 buildbot scripts to use Visual Studio 2008, and
  to use the required versions of external sources.
  External sources are not yet built, so the build-step fails to
  built some targets.
........
  r59880 | thomas.heller | 2008-01-09 22:35:43 +0100 (Wed, 09 Jan 2008) | 6 lines

  Change amd64 buildbot scripts to use Visual Studio 2008, and
  to use the required versions of external sources.
  External sources are not yet built, so the build-step fails to
  built some targets.
........

Doc/library/collections.rst
Lib/test/test_import.py
Modules/_cursesmodule.c
PC/VS8.0/_ctypes.vcproj
PCbuild/_ctypes.vcproj
Python/import.c
Tools/buildbot/build-amd64.bat
Tools/buildbot/clean-amd64.bat
Tools/buildbot/external-amd64.bat

index 0c440d6b6e20f3db9c37b3616aa7e293d7136c9a..6f2961a00d5e8b235376d5a59c97442e9ded2c77 100644 (file)
@@ -510,7 +510,7 @@ field names, the method and attribute names start with an underscore.
       Point(x=33, y=22)
 
       >>> for partnum, record in inventory.items():
-              inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())
+      ...     inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())
 
 .. attribute:: somenamedtuple._fields
 
@@ -525,7 +525,7 @@ field names, the method and attribute names start with an underscore.
       >>> Color = namedtuple('Color', 'red green blue')
       >>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)
       >>> Pixel(11, 22, 128, 255, 0)
-      Pixel(x=11, y=22, red=128, green=255, blue=0)'
+      Pixel(x=11, y=22, red=128, green=255, blue=0)
 
 To retrieve a field whose name is stored in a string, use the :func:`getattr`
 function::
@@ -544,14 +544,14 @@ functionality with a subclass.  Here is how to add a calculated field and
 a fixed-width print format::
 
     >>> class Point(namedtuple('Point', 'x y')):
-        @property
-        def hypot(self):
-            return (self.x ** 2 + self.y ** 2) ** 0.5
-        def __str__(self):
-            return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
+    ...     @property
+    ...     def hypot(self):
+    ...         return (self.x ** 2 + self.y ** 2) ** 0.5
+    ...     def __str__(self):
+    ...         return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
 
     >>> for p in Point(3,4), Point(14,5), Point(9./7,6):
-            print p
+    ...     print p
 
     Point: x= 3.000 y= 4.000 hypot= 5.000
     Point: x=14.000 y= 5.000 hypot=14.866
@@ -560,7 +560,7 @@ a fixed-width print format::
 Another use for subclassing is to replace performance critcal methods with
 faster versions that bypass error-checking and that localize variable access::
 
-    >>> class Point(namedtuple('Point', 'x y')):
+    class Point(namedtuple('Point', 'x y')):
         _make = classmethod(tuple.__new__)
         def _replace(self, _map=map, **kwds):
             return self._make(_map(kwds.get, ('x', 'y'), self))
index 760713e69cf86700f28b97cc0431bab2c16aece1..d8f2d51b206b0a2b7f10c97eebd8bfb0a0bce0df 100644 (file)
@@ -221,6 +221,16 @@ class ImportTest(unittest.TestCase):
                 del sys.modules[TESTFN]
 
 
+    def test_importbyfilename(self):
+        path = os.path.abspath(TESTFN)
+        try:
+            __import__(path)
+        except ImportError as err:
+            self.assertEqual("Import by filename is not supported.",
+                              err.args[0])
+        else:
+            self.fail("import by path didn't raise an exception")
+
 class PathsTests(unittest.TestCase):
     SAMPLES = ('test', 'test\u00e4\u00f6\u00fc\u00df', 'test\u00e9\u00e8',
                'test\u00b0\u00b3\u00b2')
index 57f9058ce82521e8e80654d3f2ea41d5d60b3789..a4536e47dc7b9b453554fec369845aabdd6a79c6 100644 (file)
@@ -677,25 +677,30 @@ PyCursesWindow_ChgAt(PyCursesWindowObject *self, PyObject *args)
   int num = -1;
   short color;
   attr_t attr = A_NORMAL;
+  long lattr;
   int use_xy = FALSE;
 
   switch (PyTuple_Size(args)) {
   case 1:
-    if (!PyArg_ParseTuple(args,"l;attr", &attr))
+    if (!PyArg_ParseTuple(args,"l;attr", &lattr))
       return NULL;
+    attr = lattr;
     break;
   case 2:
-    if (!PyArg_ParseTuple(args,"il;n,attr", &num, &attr))
+    if (!PyArg_ParseTuple(args,"il;n,attr", &num, &lattr))
       return NULL;
+    attr = lattr;
     break;
   case 3:
-    if (!PyArg_ParseTuple(args,"iil;int,int,attr", &y, &x, &attr))
+    if (!PyArg_ParseTuple(args,"iil;int,int,attr", &y, &x, &lattr))
       return NULL;
+    attr = lattr;
     use_xy = TRUE;
     break;
   case 4:
-    if (!PyArg_ParseTuple(args,"iiil;int,int,n,attr", &y, &x, &num, &attr))
+    if (!PyArg_ParseTuple(args,"iiil;int,int,n,attr", &y, &x, &num, &lattr))
       return NULL;
+    attr = lattr;
     use_xy = TRUE;
     break;
   default:
index bb68ad9ba1cb6c4a33a0e63a4a080f36853a4210..931d5fc0880fcdf2d0183c5fbe86eb40d35ac153 100644 (file)
                                        <Tool\r
                                                Name="VCCustomBuildTool"\r
                                                CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"\r
+                                               Outputs="$(IntDir)\win64.obj"\r
                                        />\r
                                </FileConfiguration>\r
                                <FileConfiguration\r
index f923ca0d5c3aabb922f9a24110f79892c1e7b93e..d654a9be8e763601f6c88ef9146978e67e059029 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="9,00"
+       Version="9.00"
        Name="_ctypes"
        ProjectGUID="{0E9791DB-593A-465F-98BC-681011311618}"
        RootNamespace="_ctypes"
                                        <Tool
                                                Name="VCCustomBuildTool"
                                                CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+                                               Outputs="$(IntDir)\win64.obj"
                                        />
                                </FileConfiguration>
                                <FileConfiguration
index 6500f23bc89f267637b3e0f2fae4ec9fca2ce1ce..f9d4246a2bddfc84951b77ba7fcb4cdaa1ff0f4e 100644 (file)
@@ -2000,6 +2000,16 @@ import_module_level(char *name, PyObject *globals, PyObject *locals,
        Py_ssize_t buflen = 0;
        PyObject *parent, *head, *next, *tail;
 
+       if (strchr(name, '/') != NULL
+#ifdef MS_WINDOWS
+           || strchr(name, '\\') != NULL
+#endif
+               ) {
+               PyErr_SetString(PyExc_ImportError,
+                               "Import by filename is not supported.");
+               return NULL;
+       }
+
        parent = get_parent(globals, buf, &buflen, level);
        if (parent == NULL)
                return NULL;
index cddd3dde6e4504660c214c75d288a9ae83b69dd9..b74086e174707e5deb88616199a7ca18843a02ca 100644 (file)
@@ -1,6 +1,5 @@
 @rem Used by the buildbot "compile" step.
-setlocal
 cmd /c Tools\buildbot\external-amd64.bat
-call "%VS71COMNTOOLS%vsvars32.bat"
+call "%VS90COMNTOOLS%vsvars32.bat"
 REM cmd /q/c Tools\buildbot\kill_python.bat
-devenv.com /build ReleaseAMD64 PC\VS7.1\pcbuild.sln
+vcbuild PCbuild\pcbuild.sln "Debug|x64"
index 585476a4856dae6016fa22355c5975b1bf5061c7..0fc3617554df06573e13c500d03a93e126a6dfa1 100644 (file)
@@ -1,6 +1,7 @@
 @rem Used by the buildbot "clean" step.
-call "%VS71COMNTOOLS%vsvars32.bat"
-cd PC\VS7.1
+call "%VS90COMNTOOLS%vsvars32.bat"
+cd PCbuild
 @echo Deleting .pyc/.pyo files ...
 del /s Lib\*.pyc Lib\*.pyo
-devenv.com /clean ReleaseAMD64 pcbuild.sln
+vcbuild /clean pcbuild.sln "Release|x64"
+vcbuild /clean pcbuild.sln "Debug|x64"
index ec9e6b6214531499d003e777ab603bb08f0751bd..3e5c8595abccf8248808ab00a1ffa3a879cdfb34 100644 (file)
@@ -1,50 +1,43 @@
 @rem Fetches (and builds if necessary) external dependencies
-setlocal
 
-@rem need this so that 'devenv' is found
-call "%VS71COMNTOOLS%vsvars32.bat"
-@rem set the build environment
-call "%MSSdk%\SetEnv" /XP64 /RETAIL
+@REM XXX FIXME - building for x64 disabled for now.
 
 @rem Assume we start inside the Python source directory
-for %%i in (.) do set CWD=%%~fi
 cd ..
-
-@rem sqlite
-if not exist sqlite-source-3.3.4 (
-   svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
-   if exist %CWD%\PCbuild\sqlite3.dll del %CWD%\PCbuild\sqlite3.dll
-)
-if not exist %CWD%\PCbuild\sqlite3.dll (
-   cd sqlite-source-3.3.4\amd64
-   cl ..\*.c
-   link /def:..\sqlite3.def  /dll *.obj /out:sqlite3.dll bufferoverflowU.lib
-   cd ..\..
-   copy sqlite-source-3.3.4\amd64\sqlite3.dll %CWD%\PCbuild
-)
+call "%VS90COMNTOOLS%vsvars32.bat"
 
 @rem bzip
 if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3
-if not exist bzip2-1.0.3\libbz2.lib (
-   cd bzip2-1.0.3
-   nmake /f makefile.msc CFLAGS="-DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo /GS-"
-   cd ..
-)
 
 @rem Sleepycat db
 if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
-if not exist "db-4.4.20\build_win32\Release_AMD64\libdb44s.lib" (
-   cd db-4.4.20\build_win32
-   devenv Berkeley_DB.sln /build "Release AMD64" /project db_static /useenv
-   cd ..\..
-)
+@REM if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
+@REM    vcbuild db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static
+@REM )
 
 @rem OpenSSL
-if not exist openssl-0.9.8a svn export http://svn.python.org/projects/external/openssl-0.9.8a
+if not exist openssl-0.9.8g (
+  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a
+  svn export http://svn.python.org/projects/external/openssl-0.9.8g
+)
 
 @rem tcltk
-if not exist tcl8.4.12 (
+if not exist tcl8.4.16 (
    if exist tcltk rd /s/q tcltk
-   svn export http://svn.python.org/projects/external/tcl8.4.12
-   svn export http://svn.python.org/projects/external/tk8.4.12
+   if exist tcl8.4.12 rd /s/q tcl8.4.12
+   if exist tk8.4.12 rd /s/q tk8.4.12
+   svn export http://svn.python.org/projects/external/tcl8.4.16
+   svn export http://svn.python.org/projects/external/tk8.4.16
+@REM    cd tcl8.4.16\win
+@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
+@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
+@REM    cd ..\..
+@REM    cd tk8.4.16\win
+@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
+@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
+@REM    cd ..\..
 )
+
+@rem sqlite
+if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
+@REM if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild