Re: AttributeError: module 'socket' has no attribute 'timeout'

2019-04-25 Thread Alexandros Afentoulis
On 4/25/19 10:04 AM, Artem Golubev wrote: Hello,  I’m using python3.5, python3.7 on Debian 9 stretch This is my code: [snip] When I execute my code I receive this error *** Traceback (most recent call last):   File "/root/python/projects/test/socket.py", line 7, in     sock =

Re: AttributeError: module 'socket' has no attribute 'timeout'

2019-04-25 Thread Neil Williams
On Thu, 25 Apr 2019 10:04:46 +0300 Artem Golubev wrote: > Hello, I’m using python3.5, python3.7 on Debian 9 stretch Simply rename the script and delete any socket.pyc file in the same directory. * Do not name your script using the name of a module that you will be importing: > File "/root

AttributeError: module 'socket' has no attribute 'timeout'

2019-04-25 Thread Artem Golubev
Hello, I’m using python3.5, python3.7 on Debian 9 stretch This is my code: ———- import socket host = 'google.com’ port = 80 try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(0.1) result = sock.connect_ex((host, port)) if result == 0: prin