barneygale / mark2

minecraft server wrapper, written in python with twisted
Other
105 stars 27 forks source link

get_jvm_options treats 0/1 as true/false #114

Open mr2013 opened 11 years ago

mr2013 commented 11 years ago

When using an option like java.cli.XX.ParallelGCThreads=1 in the config, the expected java parameter is -XX:ParallelGCThreads=1. Instead, the function treats the 1 as True, and sets the option to -XX:+ParallelGCThreads, thus rendering the JVM unable to start.

Suggested change, properties.py, line 172: Replace

if v in (True, False):

With

if v is True or v is False:
prophile commented 10 years ago

To make the intention here clearer, might I offer:

if type(v) == bool: