graphite-project / carbon

Unnecessary else / elif used after return PYL-R1705
Style
Major
3 occurrences in this check
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
136      events.resumeReceivingMetrics.addHandler(self.resumeReceiving)
137
138  def getPeerName(self):
139    if hasattr(self.transport, 'getPeer'):140      peer = self.transport.getPeer()
141      return "%s:%d" % (peer.host, peer.port)
142    else:
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 44    clients = len(state.connectedMetricReceiverProtocols)
 45    max_clients = settings.MAX_RECEIVER_CONNECTIONS
 46
 47    if clients < max_clients: 48      return ServerFactory.buildProtocol(self, addr)
 49    else:
 50      return None
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
132
133
134def _process_alive(pid):
135    if exists("/proc"):136        return exists("/proc/%d" % pid)
137    else:
138        try: