GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#22)
by
unknown
01:13
created

ejabberd_testserver_is_up()   A

Complexity

Conditions 3

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 3
1
# -*- coding: utf-8 -*-
2
from __future__ import unicode_literals, print_function
3
import socket
4
from xmlrpc.client import ServerProxy
5
6
7
def ejabberd_testserver_is_up(url):
8
    proxy = ServerProxy(url)
9
10
    try:
11
        proxy._()   # Call a fictive method.
12
    except socket.error:
13
        # Not connected ; socket error mean that the service is unreachable.
14
        return False
15
    except BaseException:
16
        # connected to the server and the method doesn't exist which is expected.
17
        pass
18
19
    # Just in case the method is registered in the XmlRPC server
20
    return True
21