Skip to content

Commit 1ea5d46

Browse files
committed
-
1 parent 9594aa2 commit 1ea5d46

File tree

1 file changed

+3
-67
lines changed

1 file changed

+3
-67
lines changed
Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# Copyright 2009-2013 Ram Rachum.
22
# This program is distributed under the MIT license.
33

4-
'''
5-
A bootstrap module for `python_toolbox`.
6-
7-
It checks all prerequisites are installed.
8-
'''
9-
104
import sys
115

126
### Confirming correct Python version: ########################################
137
# #
148
if sys.version_info[0] >= 3:
159
raise Exception("Python 3.x is not supported, only Python 2.6 and Python "
1610
"2.7.")
17-
if sys.version_info[1] <= 4:
11+
if sys.version_info[1] <= 5:
1812
raise Exception(
1913
"You're using Python <= 2.5, but this package requires either Python "
2014
"2.6 or Python 2.7, so you can't use it unless you upgrade your "
@@ -24,63 +18,5 @@
2418
### Finished confirming correct Python version. ###############################
2519

2620

27-
frozen = getattr(sys, 'frozen', None)
28-
is_pypy = ('__pypy__' in sys.builtin_module_names)
29-
30-
31-
def __check_prerequisites():
32-
'''
33-
Check that all modules required for `python_toolbox` are installed.
34-
35-
Returns a list of some imported modules: A reference to this list should be
36-
kept alive so to prevent the imported modules from being garbage-collected,
37-
which would cause Python to load them twice, which would needlessly
38-
increase startup time.
39-
'''
40-
41-
modules = []
42-
43-
class MissingModule(Exception):
44-
'''A required module is not found.'''
45-
46-
def check_pkg_resources():
47-
try:
48-
import pkg_resources
49-
except ImportError:
50-
raise MissingModule(
51-
"`pkg_resources` is required, but it's not currently "
52-
"installed on your system. It comes with `distribute`, so "
53-
"please install it according to the instructions here: "
54-
"http://pypi.python.org/pypi/distribute"
55-
)
56-
else:
57-
return [pkg_resources]
58-
59-
def check_distribute():
60-
if frozen:
61-
# Can't check that `distribute` is installed when frozen with
62-
# `py2exe`.
63-
return []
64-
import pkg_resources
65-
try:
66-
pkg_resources.require('distribute')
67-
except pkg_resources.DistributionNotFound:
68-
raise MissingModule(
69-
"`distribute` is required, but it's not currently installed "
70-
"on your system. Please install it according to the "
71-
"instructions here: http://pypi.python.org/pypi/distribute"
72-
)
73-
else:
74-
# Returning empty list because we didn't import `distribute`:
75-
return []
76-
77-
78-
checkers = [check_pkg_resources, check_distribute]
79-
80-
for checker in checkers:
81-
modules += checker()
82-
83-
return modules
84-
85-
86-
__modules_list = __check_prerequisites()
21+
#frozen = getattr(sys, 'frozen', None)
22+
#is_pypy = ('__pypy__' in sys.builtin_module_names)

0 commit comments

Comments
 (0)