Skip to content

Commit 0abcaa0

Browse files
Fixed possible compatibility issue
This allows the program to read in first what the user previously selected as the library location, as opposed to making the user set the location every time he/she opens the program. It also prevents an issue to occur where if compiled and the user does not select a location, an IOError would arise. This prevents that.
1 parent bca1f92 commit 0abcaa0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

PropCCompiler.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ def compile(self, action, code):
9292
def get_includes(self, includes):
9393
global lib_descriptor
9494

95-
lib_descriptor = json.load(open(os.getcwd() + "/lib-descriptor.json"))
95+
try:
96+
lib_descriptor = json.load(open(os.getcwd() + "/lib-descriptor.json"))
97+
except:
98+
lib_descriptor = json.load(open(os.getcwd() + "/propeller-c-lib/lib-descriptor.json" ))
9699

97100
descriptors = []
98101
for include in includes:
@@ -140,6 +143,6 @@ def create_executing_data(self, c_file, binary_file, descriptors):
140143

141144

142145
try:
143-
lib_descriptor = json.load(open(os.getcwd() + "/propeller-c-lib/lib-descriptor.json"))
146+
lib_descriptor = json.load(open(os.getcwd() + "/lib-descriptor.json"))
144147
except:
145-
lib_descriptor = json.load(open(os.getcwd() + "/lib-descriptor.json"))
148+
lib_descriptor = json.load(open(os.getcwd() + "/propeller-c-lib/lib-descriptor.json"))

0 commit comments

Comments
 (0)