pnijhara / gitsome

Useless else clause detected on the loop PYL-W0120
Bug risk
Major
4 years ago4 years old
Else clause on loop without a break statement
145            if verbose:
146                sys.stderr.write("duplicate: %s (%s)\n" % potential)
147            return None
148    else:149        if not stat.S_ISREG(os.stat(potential[0]).st_mode):
150            if verbose:
151                sys.stderr.write("not a regular file: %s (%s)\n" % potential)
Else clause on loop without a break statement
147            # will actually return the 2nd line in the code_context field, even though
148            # line number is itself correct. We manually fix that in this branch.
149            return fname
150    else:151        msg = (
152            "xonsh: warning: __file__ name could not be found. You may be "
153            "trying to trace interactively. Please pass in the file names "
Else clause on loop without a break statement
 205        for e in x:
 206            if hasglobstar(e):
 207                return True
 208        else: 209            return False
 210    else:
 211        return False
Else clause on loop without a break statement
 67                    hist_file = xt.expanduser_abs_path(hist_file)
 68                    if os.path.isfile(hist_file):
 69                        return hist_file
 70    else: 71        if default:
 72            default = xt.expanduser_abs_path(default)
 73            if os.path.isfile(default):