mirror of https://github.com/nucypher/nucypher.git
Merge pull request #352 from szotov/windows
Minor improvements for Windows compatibilitypull/370/merge
commit
18cddabe4a
|
@ -1,4 +1,4 @@
|
|||
import distutils
|
||||
import shutil
|
||||
import itertools
|
||||
import os
|
||||
|
||||
|
@ -9,10 +9,12 @@ from solc.exceptions import SolcError
|
|||
|
||||
|
||||
class SolidityCompiler:
|
||||
__default_version = 'v0.4.22'
|
||||
__default_version = 'v0.4.24'
|
||||
__default_configuration_path = os.path.join(dirname(abspath(__file__)), './compiler.json')
|
||||
|
||||
__bin_path = os.path.dirname(distutils.spawn.find_executable('python'))
|
||||
__default_sol_binary_path = shutil.which('solc')
|
||||
if __default_sol_binary_path is None:
|
||||
__bin_path = os.path.dirname(shutil.which('python'))
|
||||
__default_sol_binary_path = os.path.join(__bin_path, 'solc')
|
||||
|
||||
__default_contract_dir = os.path.join(dirname(abspath(__file__)), 'source', 'contracts')
|
||||
|
|
|
@ -125,7 +125,7 @@ def check_config_tree(configuration_dir: str=None) -> bool:
|
|||
|
||||
def check_config_runtime() -> bool:
|
||||
rules = (
|
||||
(os.getuid() != 0, 'Cannot run as root user.'),
|
||||
(os.name == 'nt' or os.getuid() != 0, 'Cannot run as root user.'),
|
||||
)
|
||||
|
||||
for rule, failure_reason in rules:
|
||||
|
|
|
@ -40,8 +40,9 @@ def tempfile_path():
|
|||
"""
|
||||
User is responsible for closing the file given at the path.
|
||||
"""
|
||||
_, path = tempfile.mkstemp()
|
||||
fd, path = tempfile.mkstemp()
|
||||
yield path
|
||||
os.close(fd)
|
||||
os.remove(path)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue