Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async and await are reserved keywords in python 3.7 #188

Closed
bsipocz opened this issue Dec 18, 2018 · 3 comments
Closed

async and await are reserved keywords in python 3.7 #188

bsipocz opened this issue Dec 18, 2018 · 3 comments

Comments

@bsipocz
Copy link

bsipocz commented Dec 18, 2018

Thus https://github.com/pymc-devs/pymc/blob/master/pymc/threadpool.py#L346 causes a SyntaxError at the time of importing pymc.

I suppose there is no plans to do another release here, but if it's a possibility I'm happy to open a PR to rename the method.

@boegel
Copy link

boegel commented Mar 19, 2020

I ran into a SyntaxError as well when trying to install pymc with Python 3.7 (as a dependency for HDDM), fixed with the following patch:

await is a keyword in Python 3.7+, so rename 'await' method to avoid SyntaxError

--- pymc-2.3.7/pymc/threadpool.py.orig	2020-03-19 17:48:14.572211381 +0100
+++ pymc-2.3.7/pymc/threadpool.py	2020-03-19 17:49:39.573111182 +0100
@@ -343,7 +343,7 @@
             self.main_lock.release()
         self.counter_lock.release()
 
-    def await(self):
+    def waitforit(self):
         self.main_lock.acquire()
         self.main_lock.release()
 
@@ -384,7 +384,7 @@
                         exc_callback=eb,
                         args=args,
                         requestID=id(args)))
-    done_lock.await()
+    done_lock.waitforit()
 
     if exceptions:
         six.reraise(*exceptions[0])

@twiecki
Copy link
Member

twiecki commented Mar 20, 2020

@boegel want to do a PR?

@boegel
Copy link

boegel commented Mar 20, 2020

@twiecki I started looking into a PR, and noticed you've already fixed this in #193.

There's no release yet with this fix included though...

@twiecki twiecki closed this as completed Apr 10, 2020
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

No branches or pull requests

3 participants