Skip to content

get_platform() function not used in install script #32

@artenator

Description

@artenator
  • py-solc Version: 1.2.1
  • solc Version: 0.4.8
  • Python Version: 2.7.12
  • OS: linux (Ubuntu 16.04)

Output:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/solc/install.py", line 463, in <module>
    install_solc(identifier)
  File "/usr/local/lib/python2.7/dist-packages/solc/install.py", line 441, in install_solc
    ', '.join(sorted(INSTALL_FUNCTIONS.keys())),
ValueError: Installation of solidity is not supported on your platform (linux2). Supported platforms are: darwin, linux

This is the output I get when I try to run:
python -m solc.install v0.4.8

I believe the issue is because the get_platform function is not actually used.

def get_platform():
    if sys.platform.startswith('linux'):
        return LINUX
    elif sys.platform == OSX:
        return OSX
    elif sys.platform == WINDOWS:
        return WINDOWS
    else:
        raise KeyError("Unknown platform: {0}".format(sys.platform))

As you can see, this uses "startswith" which would allow my "linux2" kernel to pass. But this function is not actually used... see below.

def install_solc(identifier, platform=None):
    if platform is None:
        platform = sys.platform

    if platform not in INSTALL_FUNCTIONS:
        raise ValueError(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions