Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1b3bef21
Commit
1b3bef21
authored
Jan 12, 2009
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #4915: Port sysmodule to Windows CE.
parent
51a37034
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
Misc/NEWS
Misc/NEWS
+2
-0
Python/sysmodule.c
Python/sysmodule.c
+12
-3
No files found.
Misc/NEWS
View file @
1b3bef21
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #4915: Port sysmodule to Windows CE.
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
collecting the oldest generation) so that allocating lots of objects without
collecting the oldest generation) so that allocating lots of objects without
destroying them does not show quadratic performance. Based on a proposal by
destroying them does not show quadratic performance. Based on a proposal by
...
...
Python/sysmodule.c
View file @
1b3bef21
...
@@ -1296,8 +1296,13 @@ _PySys_Init(void)
...
@@ -1296,8 +1296,13 @@ _PySys_Init(void)
PyDict_SetItemString(sysdict, key, v); \
PyDict_SetItemString(sysdict, key, v); \
Py_XDECREF(v)
Py_XDECREF(v)
/* Check that stdin is not a directory
Using shell redirection, you can redirect stdin to a directory,
crashing the Python interpreter. Catch this common mistake here
and output a useful error message. Note that under MS Windows,
the shell already prevents that. */
#if !defined(MS_WINDOWS)
{
{
/* XXX: does this work on Win/Win64? (see posix_fstat) */
struct
stat
sb
;
struct
stat
sb
;
if
(
fstat
(
fileno
(
stdin
),
&
sb
)
==
0
&&
if
(
fstat
(
fileno
(
stdin
),
&
sb
)
==
0
&&
S_ISDIR
(
sb
.
st_mode
))
{
S_ISDIR
(
sb
.
st_mode
))
{
...
@@ -1307,6 +1312,7 @@ _PySys_Init(void)
...
@@ -1307,6 +1312,7 @@ _PySys_Init(void)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#endif
/* Closing the standard FILE* if sys.std* goes aways causes problems
/* Closing the standard FILE* if sys.std* goes aways causes problems
* for embedded Python usages. Closing them when somebody explicitly
* for embedded Python usages. Closing them when somebody explicitly
...
@@ -1526,7 +1532,7 @@ PySys_SetArgv(int argc, char **argv)
...
@@ -1526,7 +1532,7 @@ PySys_SetArgv(int argc, char **argv)
{
{
#if defined(HAVE_REALPATH)
#if defined(HAVE_REALPATH)
char
fullpath
[
MAXPATHLEN
];
char
fullpath
[
MAXPATHLEN
];
#elif defined(MS_WINDOWS)
#elif defined(MS_WINDOWS)
&& !defined(MS_WINCE)
char
fullpath
[
MAX_PATH
];
char
fullpath
[
MAX_PATH
];
#endif
#endif
PyObject
*
av
=
makeargvobject
(
argc
,
argv
);
PyObject
*
av
=
makeargvobject
(
argc
,
argv
);
...
@@ -1571,7 +1577,10 @@ PySys_SetArgv(int argc, char **argv)
...
@@ -1571,7 +1577,10 @@ PySys_SetArgv(int argc, char **argv)
#if SEP == '\\'
/* Special case for MS filename syntax */
#if SEP == '\\'
/* Special case for MS filename syntax */
if
(
argc
>
0
&&
argv0
!=
NULL
&&
strcmp
(
argv0
,
"-c"
)
!=
0
)
{
if
(
argc
>
0
&&
argv0
!=
NULL
&&
strcmp
(
argv0
,
"-c"
)
!=
0
)
{
char
*
q
;
char
*
q
;
#ifdef MS_WINDOWS
#if defined(MS_WINDOWS) && !defined(MS_WINCE)
/* This code here replaces the first element in argv with the full
path that it represents. Under CE, there are no relative paths so
the argument must be the full path anyway. */
char
*
ptemp
;
char
*
ptemp
;
if
(
GetFullPathName
(
argv0
,
if
(
GetFullPathName
(
argv0
,
sizeof
(
fullpath
),
sizeof
(
fullpath
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment