mirror of
https://github.com/python/cpython.git
synced 2025-10-09 00:22:17 +00:00
introduce a new platform-specific variable: os.linesep is the
platform's line separator. \n on Unix, \r\n on DOS, OS/2 and Windows, \r on Macs.
This commit is contained in:
parent
fa0b6ab01a
commit
e9387ea773
1 changed files with 5 additions and 0 deletions
|
@ -25,6 +25,7 @@ altsep = None
|
||||||
|
|
||||||
if 'posix' in _names:
|
if 'posix' in _names:
|
||||||
name = 'posix'
|
name = 'posix'
|
||||||
|
linesep = '\n'
|
||||||
curdir = '.'; pardir = '..'; sep = '/'; pathsep = ':'
|
curdir = '.'; pardir = '..'; sep = '/'; pathsep = ':'
|
||||||
defpath = ':/bin:/usr/bin'
|
defpath = ':/bin:/usr/bin'
|
||||||
from posix import *
|
from posix import *
|
||||||
|
@ -37,6 +38,7 @@ if 'posix' in _names:
|
||||||
del posixpath
|
del posixpath
|
||||||
elif 'nt' in _names:
|
elif 'nt' in _names:
|
||||||
name = 'nt'
|
name = 'nt'
|
||||||
|
linesep = '\r\n'
|
||||||
curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
|
curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
|
||||||
defpath = '.;C:\\bin'
|
defpath = '.;C:\\bin'
|
||||||
from nt import *
|
from nt import *
|
||||||
|
@ -49,6 +51,7 @@ elif 'nt' in _names:
|
||||||
del ntpath
|
del ntpath
|
||||||
elif 'dos' in _names:
|
elif 'dos' in _names:
|
||||||
name = 'dos'
|
name = 'dos'
|
||||||
|
linesep = '\r\n'
|
||||||
curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
|
curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
|
||||||
defpath = '.;C:\\bin'
|
defpath = '.;C:\\bin'
|
||||||
from dos import *
|
from dos import *
|
||||||
|
@ -61,6 +64,7 @@ elif 'dos' in _names:
|
||||||
del dospath
|
del dospath
|
||||||
elif 'os2' in _names:
|
elif 'os2' in _names:
|
||||||
name = 'os2'
|
name = 'os2'
|
||||||
|
linesep = '\r\n'
|
||||||
curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
|
curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
|
||||||
defpath = '.;C:\\bin'
|
defpath = '.;C:\\bin'
|
||||||
from os2 import *
|
from os2 import *
|
||||||
|
@ -73,6 +77,7 @@ elif 'os2' in _names:
|
||||||
del ntpath
|
del ntpath
|
||||||
elif 'mac' in _names:
|
elif 'mac' in _names:
|
||||||
name = 'mac'
|
name = 'mac'
|
||||||
|
linesep = '\r'
|
||||||
curdir = ':'; pardir = '::'; sep = ':'; pathsep = '\n'
|
curdir = ':'; pardir = '::'; sep = ':'; pathsep = '\n'
|
||||||
defpath = ':'
|
defpath = ':'
|
||||||
from mac import *
|
from mac import *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue