Skip to content

Introduce some minor Python 3 changes - #180

Merged
markus-beuckelmann merged 17 commits into
clips:python3from
markus-beuckelmann:python3
Jun 5, 2017
Merged

Introduce some minor Python 3 changes#180
markus-beuckelmann merged 17 commits into
clips:python3from
markus-beuckelmann:python3

Conversation

@markus-beuckelmann

Copy link
Copy Markdown
Collaborator

This will introduce some easy, minor changes working towards Python 3 support, affecting the unit tests, pattern.web, pattern.server, pattern.db, pattern.graph, pattern.vector.

Ideally, it would be better to listen for ModuleNotFoundError instead of ImportError, but since this is only available in Python >= 3.6 let's stick to
this for now.
In Python 2, we have to make use of the "new" module in the bind() function. In contrast, this is not necessary in Python 3 because we can directly
assign the function to the object.
We should avoid catching ALL exceptions in this case since we only care about ImportError to distinguish between Python 2/3.
@markus-beuckelmann
markus-beuckelmann merged commit 8012e30 into clips:python3 Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant