diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst index 7696811a78d..f5d2ab00230 100644 --- a/Doc/c-api/sys.rst +++ b/Doc/c-api/sys.rst @@ -15,13 +15,6 @@ Operating System Utilities one of the strings ``''`` 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 diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 4d889bd5334..c8633c097c1 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -841,9 +841,6 @@ PyNumber_Xor:PyObject*::+1: 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: diff --git a/Makefile.pre.in b/Makefile.pre.in index 83824ec7b8e..1b2bcfe0536 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -264,7 +264,6 @@ PYTHON_OBJS= \ Python/getargs.o \ Python/getcompiler.o \ Python/getcopyright.o \ - Python/getmtime.o \ Python/getplatform.o \ Python/getversion.o \ Python/graminit.o \ diff --git a/Misc/NEWS b/Misc/NEWS index 416995062db..f7394fd23e6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1 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 diff --git a/PC/VC6/pythoncore.dsp b/PC/VC6/pythoncore.dsp index 5a89a44a975..756e271cabc 100644 --- a/PC/VC6/pythoncore.dsp +++ b/PC/VC6/pythoncore.dsp @@ -410,10 +410,6 @@ SOURCE=..\..\Python\getcopyright.c # 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 diff --git a/PC/VS7.1/pythoncore.vcproj b/PC/VS7.1/pythoncore.vcproj index c2ccebb3d50..601bfa096b2 100644 --- a/PC/VS7.1/pythoncore.vcproj +++ b/PC/VS7.1/pythoncore.vcproj @@ -568,9 +568,6 @@ - - diff --git a/PC/VS8.0/pythoncore.vcproj b/PC/VS8.0/pythoncore.vcproj index 4720a2fa138..d1be2683374 100644 --- a/PC/VS8.0/pythoncore.vcproj +++ b/PC/VS8.0/pythoncore.vcproj @@ -1686,10 +1686,6 @@ RelativePath="..\..\Python\getcopyright.c" > - - diff --git a/PC/os2emx/Makefile b/PC/os2emx/Makefile index 9bfd9271b00..82d548ef9e4 100644 --- a/PC/os2emx/Makefile +++ b/PC/os2emx/Makefile @@ -351,7 +351,6 @@ SRC.PYTHON= $(addprefix $(TOP), \ Python/getargs.c \ Python/getcompiler.c \ Python/getcopyright.c \ - Python/getmtime.c \ Python/getplatform.c \ Python/getversion.c \ Python/graminit.c \ diff --git a/PC/os2emx/python27.def b/PC/os2emx/python27.def index e41303d02f0..1a258e79353 100644 --- a/PC/os2emx/python27.def +++ b/PC/os2emx/python27.def @@ -931,9 +931,6 @@ EXPORTS ; From python27_s.lib(getcopyright) "Py_GetCopyright" -; From python27_s.lib(getmtime) - "PyOS_GetLastModificationTime" - ; From python27_s.lib(getplatform) "Py_GetPlatform" diff --git a/PC/os2vacpp/makefile b/PC/os2vacpp/makefile index c75bec3ded2..1608960cb76 100644 --- a/PC/os2vacpp/makefile +++ b/PC/os2vacpp/makefile @@ -1693,8 +1693,6 @@ getcopyright.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \ $(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 \ diff --git a/PC/os2vacpp/makefile.omk b/PC/os2vacpp/makefile.omk index e291627d120..a380c03d996 100644 --- a/PC/os2vacpp/makefile.omk +++ b/PC/os2vacpp/makefile.omk @@ -1155,8 +1155,6 @@ getcopyright.obj: abstract.h ceval.h classobject.h cobject.h \ 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 \ diff --git a/PC/os2vacpp/python.def b/PC/os2vacpp/python.def index 79d05b05f0b..ba0dfd699bf 100644 --- a/PC/os2vacpp/python.def +++ b/PC/os2vacpp/python.def @@ -284,7 +284,6 @@ EXPORTS PyNumber_Xor PyOS_AfterFork PyOS_FiniInterrupts - PyOS_GetLastModificationTime PyOS_InitInterrupts PyOS_InterruptOccurred PyOS_Readline diff --git a/PCbuild/pythoncore.vcproj b/PCbuild/pythoncore.vcproj index 569bad7f1c6..0d3d71e405a 100644 --- a/PCbuild/pythoncore.vcproj +++ b/PCbuild/pythoncore.vcproj @@ -1686,10 +1686,6 @@ RelativePath="..\Python\getcopyright.c" > - - diff --git a/Python/getmtime.c b/Python/getmtime.c deleted file mode 100644 index 54edb531df9..00000000000 --- a/Python/getmtime.c +++ /dev/null @@ -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 - diff --git a/Python/import.c b/Python/import.c index 40fc0186e8d..08024b21dbe 100644 --- a/Python/import.c +++ b/Python/import.c @@ -27,8 +27,6 @@ extern "C" { 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. diff --git a/RISCOS/Makefile b/RISCOS/Makefile index 1788b5c97c1..bd63e383372 100644 --- a/RISCOS/Makefile +++ b/RISCOS/Makefile @@ -135,7 +135,6 @@ OBJECTS_PYTHON =\ OBJECTS_RISCOS = \ @.Python.o.dynload_riscos\ @.Python.o.getcwd_riscos\ - @.Python.o.getmtime_riscos\ @.o.unixstuff diff --git a/RISCOS/Python/getmtime_riscos.c b/RISCOS/Python/getmtime_riscos.c deleted file mode 100644 index 9153638ffe9..00000000000 --- a/RISCOS/Python/getmtime_riscos.c +++ /dev/null @@ -1,20 +0,0 @@ -#include - -#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; -}