Skip to content

Commit 539231b

Browse files
committed
Improved platform checking
Adding platform check to setup.py Moving platform check in __init__.py as early as possible
1 parent ea9342b commit 539231b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pyreadline/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
# the file COPYING, distributed as part of this software.
88
#*****************************************************************************
99
from __future__ import print_function, unicode_literals, absolute_import
10-
11-
from . import unicode_helper
12-
from . import logger, clipboard, lineeditor, modes, console
13-
from . rlmain import *
1410
from platform import system
11+
1512
_S = system()
1613
if 'windows' != _S.lower():
1714
raise RuntimeError('pyreadline is for Windows only, not {}.'.format(_S))
1815
del system, _S
1916

17+
from . import unicode_helper
18+
from . import logger, clipboard, lineeditor, modes, console
19+
from . rlmain import *
20+
2021
from . import rlmain

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
import sys
1313
import glob
1414
from distutils.core import setup
15+
from platform import system
16+
17+
_S = system()
18+
if 'windows' != _S.lower():
19+
raise RuntimeError('pyreadline is for Windows only, not {}.'.format(_S))
1520

1621
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
1722
# update it when the contents of directories change.

0 commit comments

Comments
 (0)