Skip to content

Python3 Updates #12

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pyzen/core.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
from __future__ import with_statement
from __future__ import print_function
import sys
import os
import time
import traceback
from multiprocessing import Process, Queue
from threading import Thread, Lock
from Queue import Empty
try:
#Python3
from queue import Empty
except ImportError:
#Python2
from Queue import Empty


from pyzen.ui import load_ui

Expand Down Expand Up @@ -52,7 +59,7 @@ def run(self):
mtimes[filename] = mtime
continue
if mtime > mtimes[filename]:
print >> sys.stderr, 'Detected modification of %s, restarting.' % filename
print('Detected modification of %s, restarting.' % filename, file=sys.stderr)
self.do_reload = True
sys.exit(MAGIC_RETURN_CODE)
time.sleep(_SLEEP_TIME)
Expand Down
5 changes: 3 additions & 2 deletions pyzen/simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import sys
import os
import copy
Expand Down Expand Up @@ -28,8 +29,8 @@ def run_tests(argv):
# Run the code
fail = False
try:
exec compiled in mod.__dict__
except SystemExit, e:
exec(compiled, mod.__dict__)
except SystemExit as e:
if e.code:
fail = True

Expand Down
3 changes: 2 additions & 1 deletion pyzen/ui/win32/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
from pyzen.ui.base import PyZenUI

class Win32UI(PyZenUI):
Expand Down Expand Up @@ -26,7 +27,7 @@ def main():
time.sleep(2)
t.post_message(WM_APP, 1, 2)
time.sleep(1)
print 'Sending quit'
print('Sending quit')
t.quit()

if __name__ == '__main__':
Expand Down
3 changes: 2 additions & 1 deletion pyzen/ui/win32/wrappers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import threading

from pyzen.ui.win32.types import *
Expand Down Expand Up @@ -67,7 +68,7 @@ def message_loop(hwnd, wndproc):
else:
DispatchMessage(byref(msg))
except WindowsError:
print 'Error processing msg(%s, %s, %s)'%(msg.message, msg.wParam, msg.lParam)
print('Error processing msg(%s, %s, %s)'%(msg.message, msg.wParam, msg.lParam))
continue

class NotifyData(Structure):
Expand Down