Skip to content

Strange top level import issue #24

@lingfish

Description

@lingfish

Python 2.7.13
syncthing 2.3.1

I have no idea why the interpreter is hitting line 41, but it is:

(syncthing) jason@host:~$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from syncthing import Syncthing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jason/venv/syncthing/local/lib/python2.7/site-packages/syncthing/__init__.py", line 41
    raise SyncthingError(msg) from exc
                                 ^
SyntaxError: invalid syntax
>>> from syncthing import Syncthing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name Syncthing

Full import:

(syncthing) jason@host:~$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import syncthing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jason/venv/syncthing/local/lib/python2.7/site-packages/syncthing/__init__.py", line 41
    raise SyncthingError(msg) from exc
                                 ^
SyntaxError: invalid syntax
>>> import syncthing
>>> s = syncthing.Syncthing()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Syncthing'
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions