Bug report - configuration for VS on windows

28 views
Skip to first unread message

Howard Chivers

unread,
Nov 4, 2019, 4:46:56 AM11/4/19
to mpir-devel
Script: mpir_config.py

System: Windows 10, VS 2015, Python 3.5

Problem:
Script fails to run.
Error at line 185: os.DirEntry cannot be used as an argument to isDir()

Proposed fix (tested):

--------------------------------------
def find_src(dir_list):
  # list number from file extension
  di = {'.h': 0, '.c': 1, '.cc': 2, '.cpp': 2, '.asm': 3, '.as': 3}
  list = [[], [], [], []]
  for d in dir_list:
    for f in scandir(join(mpir_root_dir, d)):
      if f.name == '.svn':                                                                    #**** changed to f.name (from f)
        continue                        # ignore SVN directories
      if not f.is_dir():                                                                          #**** changed to f.is_dir() (from isdir(f))
        n, x = splitext(f.name)         # split into name + extension          #**** changed to f.name (from f)
        if x in di and not n in exclude_file_list:
          list[di[x]] += [(n, x, d)]    # if of the right type and is
  for x in list:                        # not in the exclude list
    x.sort(key=itemgetter(2, 0, 1))     # add it to appropriate list
  return list
--------------------------------------
Reply all
Reply to author
Forward
0 new messages