-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-31904 : Add support for VxWorks RTOS #4184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
10d4405
9d53ef2
db2e0e8
cb3aa97
1939a13
9a92b63
e997ecc
7faa281
98d3bdf
249794c
8bab325
21457f7
b6c9012
809b73a
847515f
4abb38d
08d4b40
c8c322c
fd303e0
93dca1b
288e627
c768168
e7bf7e3
f4b41a9
f94b66a
2b16c82
215bc2e
6921cf8
e62ed36
0861635
4d9158a
c6d7110
760da7a
1a0786f
9752833
aeb5a6d
dd24c10
e83c1d8
f1e3e72
29c94e6
4a59407
cf0fdd7
233711d
a290567
aa2e09f
18463dd
db70b18
dd55e39
0ad214f
7058513
a6e829f
9a9e4c6
ec4c065
1a3e146
4ec2302
fdda86b
b73d9a5
e660837
e4b940f
1e9e98c
0d014f4
228058d
7fdefac
9561d7f
a582432
f5f8a74
209108b
57750be
86fdad0
f3da70f
70e3042
7f38637
4d65430
78758f2
71a0b0e
5d2dcd0
7876778
e985afc
709f6ad
29fd9ea
9ea42d2
c7de1d7
2b5937e
a23d30f
f33eced
52f7458
e86db34
133514e
1a0239e
e6499a0
5c5e61b
5b933aa
4abcbc0
fea0a12
2bb0bfa
9197e5d
2c6f668
4e7a964
a702f6b
a747cf6
e1f0fd9
9dad132
ad3997c
fbe4165
ac8e483
73aaf36
105fcbf
0e36173
3a047a7
7df8049
b82e97b
2ef69a1
e39429a
e603320
170b3f7
a0b998d
fe61e8d
40f7d9a
09df4b7
ba4f218
972edd9
7041c76
85f315b
83b8cd8
0442599
38b4dd7
74ebbae
65c32bb
09819ef
53374cc
9b5a90b
ef20abe
e81a6c8
2e8d900
deab193
8e29fd4
8caee0f
7bc49fb
f0616ce
960dec6
f26b019
af6eaae
7b76b99
803e1a5
5588990
3db05a3
0f76411
025544a
afb5e55
aeb5d73
d5be8e1
fa9a502
7da582d
3892899
0442de5
2e84e47
ca82e3c
034a945
19b7f66
2072c80
0cd3581
622a824
a3d6c1b
bab4fe3
1d927d4
eed3c7a
98a86cb
7452f6d
e5d38de
69607b4
c59bc98
bc2e110
dfa1144
01dd52f
e5a9b35
b4c6bdc
21fb278
640cce7
f64606e
8f2516a
d16ad7f
bf0607a
785ced6
084256d
7d62768
dd7460b
61490c0
4ca9f18
8092657
22701dd
768c619
36b0634
0ba5ab7
dc42724
c79857f
cdaa817
217b2d9
61a4f27
92465c7
0461bda
72b343d
f569783
8598648
875bb82
addd1a0
37b7dc8
a74b6d6
fc9529f
cc3d30b
df4b6ff
39e4d4e
f2682d6
ddde264
d0c89e4
69ff954
d5127ac
d0ecc40
43aeefc
0b620c4
79f497a
cbcfdf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -753,7 +753,7 @@ def _syscmd_uname(option, default=''): | |
return default | ||
try: | ||
f = os.popen('uname %s 2> %s' % (option, DEV_NULL)) | ||
except (AttributeError, OSError): | ||
except (AttributeError, OSError, ValueError): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks suspicious. Does os.popen() now return different exceptions? I suspect you should fix os.popen() to trap ValueError and return OSError instead. Otherwise everyone who uses os.popen() has to deal with the new exception case. |
||
return default | ||
output = f.read().strip() | ||
rc = f.close() | ||
|
@@ -771,7 +771,7 @@ def _syscmd_file(target, default=''): | |
default in case the command should fail. | ||
|
||
""" | ||
if sys.platform in ('dos', 'win32', 'win16'): | ||
if sys.platform in ('dos', 'win32', 'win16', 'vxworks'): | ||
# XXX Others too ? | ||
return default | ||
target = _follow_symlinks(target) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ | |
import genericpath | ||
from genericpath import * | ||
|
||
_vxworks = 'vxworks' in sys.platform | ||
if _vxworks: | ||
import _vxwapi | ||
|
||
__all__ = ["normcase","isabs","join","splitdrive","split","splitext", | ||
"basename","dirname","commonprefix","getsize","getmtime", | ||
"getatime","getctime","islink","exists","lexists","isdir","isfile", | ||
|
@@ -65,13 +69,17 @@ def isabs(s): | |
"""Test whether a path is absolute""" | ||
s = os.fspath(s) | ||
sep = _get_sep(s) | ||
if _vxworks: #VxWorks paths dont always start with / and there is no good | ||
# way to find if a path is absolute. V7COR-3074, F7233 | ||
if not isinstance(s, str): | ||
s = s.decode(sys.getdefaultencoding()) | ||
return bool(_vxwapi.isAbs(s)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, you are doing the _vxworks test on every function call for every platform. Not a huge deal but isabs() might be called a lot. Instead, define a new isabs() on vxworks. |
||
return s.startswith(sep) | ||
|
||
|
||
# Join pathnames. | ||
# Ignore the previous parts if a part is absolute. | ||
# Insert a '/' unless the first part is empty or already ends in '/'. | ||
|
||
def join(a, *p): | ||
"""Join two or more pathname components, inserting '/' as needed. | ||
If any component is an absolute path, all previous path components | ||
|
@@ -401,8 +409,18 @@ def _joinrealpath(path, rest, seen): | |
pardir = '..' | ||
|
||
if isabs(rest): | ||
rest = rest[1:] | ||
path = sep | ||
if not _vxworks: | ||
rest = rest[1:] | ||
path = sep | ||
else: | ||
if rest.startswith(sep): | ||
rest = rest[1:] | ||
path = sep | ||
else: | ||
ind = rest.find(':') | ||
ind = 0 if ind < 0 else ind | ||
path = rest[:ind] | ||
rest = rest[ind:] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, runtime testing of _vxworks. Better to define a special _joinrealpath() function at module import time. |
||
|
||
while rest: | ||
name, _, rest = rest.partition(sep) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not good. First, 'try' is bare 'except' is bad news, hides bugs. Second, you are doing the 'vxworks' test on every function call, for every platform. Instead you could have something like: