[Python-checkins] r68203 - in python/trunk: Doc/c-api/sys.rst Doc/data/refcounts.dat Makefile.pre.in Misc/NEWS PC/VC6/pythoncore.dsp PC/VS7.1/pythoncore.vcproj PC/VS8.0/pythoncore.vcproj PC/os2emx/Makefile PC/os2emx/python27.def PC/os2vacpp/makefile PC/os2vacpp/makefile.omk PC/os2vacpp/python.def PCbuild/pythoncore.vcproj Python/getmtime.c Python/import.c RISCOS/Makefile RISCOS/Python/getmtime_riscos.c

martin.v.loewis python-checkins at python.org
Sat Jan 3 18:19:27 CET 2009


Author: martin.v.loewis
Date: Sat Jan  3 18:19:26 2009
New Revision: 68203

Log:
Issue #4817: Remove unused function PyOS_GetLastModificationTime.


Removed:
   python/trunk/Python/getmtime.c
   python/trunk/RISCOS/Python/getmtime_riscos.c
Modified:
   python/trunk/Doc/c-api/sys.rst
   python/trunk/Doc/data/refcounts.dat
   python/trunk/Makefile.pre.in
   python/trunk/Misc/NEWS
   python/trunk/PC/VC6/pythoncore.dsp
   python/trunk/PC/VS7.1/pythoncore.vcproj
   python/trunk/PC/VS8.0/pythoncore.vcproj
   python/trunk/PC/os2emx/Makefile
   python/trunk/PC/os2emx/python27.def
   python/trunk/PC/os2vacpp/makefile
   python/trunk/PC/os2vacpp/makefile.omk
   python/trunk/PC/os2vacpp/python.def
   python/trunk/PCbuild/pythoncore.vcproj
   python/trunk/Python/import.c
   python/trunk/RISCOS/Makefile

Modified: python/trunk/Doc/c-api/sys.rst
==============================================================================
--- python/trunk/Doc/c-api/sys.rst	(original)
+++ python/trunk/Doc/c-api/sys.rst	Sat Jan  3 18:19:26 2009
@@ -15,13 +15,6 @@
    one of the strings ``'<stdin>'`` or ``'???'``.
 
 
-.. cfunction:: long PyOS_GetLastModificationTime(char *filename)
-
-   Return the time of last modification of the file *filename*. The result is
-   encoded in the same way as the timestamp returned by the standard C library
-   function :cfunc:`time`.
-
-
 .. cfunction:: void PyOS_AfterFork()
 
    Function to update some internal state after a process fork; this should be

Modified: python/trunk/Doc/data/refcounts.dat
==============================================================================
--- python/trunk/Doc/data/refcounts.dat	(original)
+++ python/trunk/Doc/data/refcounts.dat	Sat Jan  3 18:19:26 2009
@@ -841,9 +841,6 @@
 PyNumber_Xor:PyObject*:o1:0:
 PyNumber_Xor:PyObject*:o2:0:
 
-PyOS_GetLastModificationTime:long:::
-PyOS_GetLastModificationTime:char*:filename::
-
 PyObject_AsFileDescriptor:int::: 
 PyObject_AsFileDescriptor:PyObject*:o:0:
 

Modified: python/trunk/Makefile.pre.in
==============================================================================
--- python/trunk/Makefile.pre.in	(original)
+++ python/trunk/Makefile.pre.in	Sat Jan  3 18:19:26 2009
@@ -264,7 +264,6 @@
 		Python/getargs.o \
 		Python/getcompiler.o \
 		Python/getcopyright.o \
-		Python/getmtime.o \
 		Python/getplatform.o \
 		Python/getversion.o \
 		Python/graminit.o \

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sat Jan  3 18:19:26 2009
@@ -12,6 +12,8 @@
 Core and Builtins
 -----------------
 
+- Issue #4817: Remove unused function PyOS_GetLastModificationTime.
+
 - Issue #4075: Use OutputDebugStringW in Py_FatalError.
 
 - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open

Modified: python/trunk/PC/VC6/pythoncore.dsp
==============================================================================
--- python/trunk/PC/VC6/pythoncore.dsp	(original)
+++ python/trunk/PC/VC6/pythoncore.dsp	Sat Jan  3 18:19:26 2009
@@ -410,10 +410,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\Python\getmtime.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\Python\getopt.c
 # End Source File
 # Begin Source File

Modified: python/trunk/PC/VS7.1/pythoncore.vcproj
==============================================================================
--- python/trunk/PC/VS7.1/pythoncore.vcproj	(original)
+++ python/trunk/PC/VS7.1/pythoncore.vcproj	Sat Jan  3 18:19:26 2009
@@ -569,9 +569,6 @@
 			RelativePath="..\..\Python\getcopyright.c">
 		</File>
 		<File
-			RelativePath="..\..\Python\getmtime.c">
-		</File>
-		<File
 			RelativePath="..\..\Python\getopt.c">
 		</File>
 		<File

Modified: python/trunk/PC/VS8.0/pythoncore.vcproj
==============================================================================
--- python/trunk/PC/VS8.0/pythoncore.vcproj	(original)
+++ python/trunk/PC/VS8.0/pythoncore.vcproj	Sat Jan  3 18:19:26 2009
@@ -1687,10 +1687,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\Python\getmtime.c"
-				>
-			</File>
-			<File
 				RelativePath="..\..\Python\getopt.c"
 				>
 			</File>

Modified: python/trunk/PC/os2emx/Makefile
==============================================================================
--- python/trunk/PC/os2emx/Makefile	(original)
+++ python/trunk/PC/os2emx/Makefile	Sat Jan  3 18:19:26 2009
@@ -351,7 +351,6 @@
 		Python/getargs.c \
 		Python/getcompiler.c \
 		Python/getcopyright.c \
-		Python/getmtime.c \
 		Python/getplatform.c \
 		Python/getversion.c \
 		Python/graminit.c \

Modified: python/trunk/PC/os2emx/python27.def
==============================================================================
--- python/trunk/PC/os2emx/python27.def	(original)
+++ python/trunk/PC/os2emx/python27.def	Sat Jan  3 18:19:26 2009
@@ -931,9 +931,6 @@
 ; From python27_s.lib(getcopyright)
   "Py_GetCopyright"
 
-; From python27_s.lib(getmtime)
-  "PyOS_GetLastModificationTime"
-
 ; From python27_s.lib(getplatform)
   "Py_GetPlatform"
 

Modified: python/trunk/PC/os2vacpp/makefile
==============================================================================
--- python/trunk/PC/os2vacpp/makefile	(original)
+++ python/trunk/PC/os2vacpp/makefile	Sat Jan  3 18:19:26 2009
@@ -1693,8 +1693,6 @@
 	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
 	 $(PY_INCLUDE)\tupleobject.h
 
-getmtime.obj: pyconfig.h
-
 getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
 	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
 	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \

Modified: python/trunk/PC/os2vacpp/makefile.omk
==============================================================================
--- python/trunk/PC/os2vacpp/makefile.omk	(original)
+++ python/trunk/PC/os2vacpp/makefile.omk	Sat Jan  3 18:19:26 2009
@@ -1155,8 +1155,6 @@
 	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
 	 stringobject.h sysmodule.h traceback.h tupleobject.h
 
-getmtime.obj: pyconfig.h
-
 getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
 	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
 	 import.h intobject.h intrcheck.h listobject.h longobject.h \

Modified: python/trunk/PC/os2vacpp/python.def
==============================================================================
--- python/trunk/PC/os2vacpp/python.def	(original)
+++ python/trunk/PC/os2vacpp/python.def	Sat Jan  3 18:19:26 2009
@@ -284,7 +284,6 @@
                PyNumber_Xor
                PyOS_AfterFork
                PyOS_FiniInterrupts
-               PyOS_GetLastModificationTime
                PyOS_InitInterrupts
                PyOS_InterruptOccurred
                PyOS_Readline

Modified: python/trunk/PCbuild/pythoncore.vcproj
==============================================================================
--- python/trunk/PCbuild/pythoncore.vcproj	(original)
+++ python/trunk/PCbuild/pythoncore.vcproj	Sat Jan  3 18:19:26 2009
@@ -1687,10 +1687,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Python\getmtime.c"
-				>
-			</File>
-			<File
 				RelativePath="..\Python\getopt.c"
 				>
 			</File>

Deleted: python/trunk/Python/getmtime.c
==============================================================================
--- python/trunk/Python/getmtime.c	Sat Jan  3 18:19:26 2009
+++ (empty file)
@@ -1,26 +0,0 @@
-
-/* Subroutine to get the last modification time of a file */
-
-/* (A separate file because this may be OS dependent) */
-
-#include "Python.h"
-#include "pyconfig.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-time_t
-PyOS_GetLastModificationTime(char *path, FILE *fp)
-{
-	struct stat st;
-	if (fstat(fileno(fp), &st) != 0)
-		return -1;
-	else
-		return st.st_mtime;
-}
-
-#ifdef __cplusplus
-}
-#endif
-

Modified: python/trunk/Python/import.c
==============================================================================
--- python/trunk/Python/import.c	(original)
+++ python/trunk/Python/import.c	Sat Jan  3 18:19:26 2009
@@ -27,8 +27,6 @@
 typedef unsigned short mode_t;
 #endif
 
-extern time_t PyOS_GetLastModificationTime(char *, FILE *);
-						/* In getmtime.c */
 
 /* Magic word to reject .pyc files generated by other Python versions.
    It should change for each incompatible change to the bytecode.

Modified: python/trunk/RISCOS/Makefile
==============================================================================
--- python/trunk/RISCOS/Makefile	(original)
+++ python/trunk/RISCOS/Makefile	Sat Jan  3 18:19:26 2009
@@ -135,7 +135,6 @@
 OBJECTS_RISCOS = \
 	@.Python.o.dynload_riscos\
 	@.Python.o.getcwd_riscos\
-	@.Python.o.getmtime_riscos\
 	@.o.unixstuff
 
 

Deleted: python/trunk/RISCOS/Python/getmtime_riscos.c
==============================================================================
--- python/trunk/RISCOS/Python/getmtime_riscos.c	Sat Jan  3 18:19:26 2009
+++ (empty file)
@@ -1,20 +0,0 @@
-#include <stdio.h>
-
-#define __swi
-#include "oslib/osfile.h"
-
-long PyOS_GetLastModificationTime(char *path, FILE *fp)
-{
-  int obj;
-  bits load, exec, ftype;
-
-  if (xosfile_read_stamped_no_path(path, &obj, &load, &exec, 0, 0, &ftype)) return -1;
-  if (obj != osfile_IS_FILE) return -1;
-  if (ftype == osfile_TYPE_UNTYPED) return -1;
-
-  load &= 0xFF;
-  load -= 51;
-  if (exec < 1855548004U) load--;
-  exec -= 1855548004U;
-  return exec/100+42949672*load+(95*load)/100;
-}


More information about the Python-checkins mailing list