Skip to content

Commit cd33daf

Browse files
committed
fix site and sysconfig modules for VxWorks RTOS
1 parent 490c542 commit cd33daf

5 files changed

Lines changed: 16 additions & 5 deletions

File tree

Doc/library/site.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ Module contents
178178
:func:`getusersitepackages` hasn't been called yet. Default value is
179179
:file:`~/.local/lib/python{X.Y}/site-packages` for UNIX and non-framework Mac
180180
OS X builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for Mac
181-
framework builds, and :file:`{%APPDATA%}\\Python\\Python{XY}\\site-packages`
182-
on Windows. This directory is a site directory, which means that
181+
framework builds, :file:`{sys.prefix}/lib/python{X.Y}/site-packages` for
182+
VxWorks, and :file:`{%APPDATA%}\\Python\\Python{XY}\\site-packages` on
183+
Windows. This directory is a site directory, which means that
183184
:file:`.pth` files in it will be processed.
184185

185186

@@ -188,7 +189,8 @@ Module contents
188189
Path to the base directory for the user site-packages. Can be ``None`` if
189190
:func:`getuserbase` hasn't been called yet. Default value is
190191
:file:`~/.local` for UNIX and Mac OS X non-framework builds,
191-
:file:`~/Library/Python/{X.Y}` for Mac framework builds, and
192+
:file:`~/Library/Python/{X.Y}` for Mac framework builds,
193+
:file:`{sys.prefix}` for VxWorks builds, and
192194
:file:`{%APPDATA%}\\Python` for Windows. This value is used by Distutils to
193195
compute the installation directories for scripts, data files, Python modules,
194196
etc. for the :ref:`user installation scheme <inst-alt-install-user>`.

Lib/site.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ def joinuser(*args):
266266
return joinuser("~", "Library", sys._framework,
267267
"%d.%d" % sys.version_info[:2])
268268

269+
if sys.platform == "vxworks":
270+
return sys.prefix
271+
269272
return joinuser("~", ".local")
270273

271274

Lib/sysconfig.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ def joinuser(*args):
201201
return joinuser("~", "Library", sys._framework,
202202
"%d.%d" % sys.version_info[:2])
203203

204+
if sys.platform == "vxworks":
205+
return sys.prefix
206+
204207
return joinuser("~", ".local")
205208

206209

Lib/test/test_site.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,10 @@ def test_no_home_directory(self):
303303
del environ['APPDATA']
304304

305305
user_base = site.getuserbase()
306-
self.assertTrue(user_base.startswith('~' + os.sep),
307-
user_base)
306+
307+
if sys.platform != "vxworks":
308+
self.assertTrue(user_base.startswith('~' + os.sep),
309+
user_base)
308310

309311
user_site = site.getusersitepackages()
310312
self.assertTrue(user_site.startswith(user_base), user_site)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix site and sysconfig modules for VxWorks RTOS

0 commit comments

Comments
 (0)