mirror of https://github.com/python/cpython.git
* Python/getmtime.c: Remove mac specifics (Mac subdirectory has
its own version now) * Python/bltinmodule.c (builtin_tuple): use pre-existing listtuple(v) for lists
This commit is contained in:
parent
f6971e2958
commit
e4ab6475f1
|
@ -1178,19 +1178,8 @@ builtin_tuple(self, v)
|
||||||
INCREF(v);
|
INCREF(v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
if (is_listobject(v)) {
|
if (is_listobject(v))
|
||||||
int n = getlistsize(v);
|
return listtuple(v);
|
||||||
object *t = newtupleobject(n);
|
|
||||||
if (t != NULL) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < n; i++) {
|
|
||||||
object *item = getlistitem(v, i);
|
|
||||||
INCREF(item);
|
|
||||||
settupleitem(t, i, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
if (is_stringobject(v)) {
|
if (is_stringobject(v)) {
|
||||||
int n = getstringsize(v);
|
int n = getstringsize(v);
|
||||||
object *t = newtupleobject(n);
|
object *t = newtupleobject(n);
|
||||||
|
|
|
@ -30,12 +30,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef macintosh
|
|
||||||
#include "stat.h"
|
|
||||||
#else
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
long
|
long
|
||||||
getmtime(path)
|
getmtime(path)
|
||||||
|
|
Loading…
Reference in New Issue