Fixed a bug when finding the module name from the file name stripping the file name extension.

This commit is contained in:
依瑪貓 2016-12-23 15:04:07 +08:00
parent 6b0aafbdef
commit 0ad8fcbacf

View File

@ -148,7 +148,7 @@ def read_in_source_dir(projdir, ext, encoding):
path = os.path.join(projdir, entry) path = os.path.join(projdir, entry)
if os.path.isfile(path) \ if os.path.isfile(path) \
and entry.lower().endswith(ext.lower()): and entry.lower().endswith(ext.lower()):
modname = entry[0:-3] modname = entry[0:-len(ext)]
modules[modname] = read_file(path, encoding) modules[modname] = read_file(path, encoding)
return modules return modules