Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
afeb42e5
Commit
afeb42e5
authored
Aug 30, 2007
by
Collin Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kill more lingering string exceptions in Lib/plat-mac/.
parent
8e6d1060
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
Lib/plat-mac/FrameWork.py
Lib/plat-mac/FrameWork.py
+2
-2
Lib/plat-mac/MiniAEFrame.py
Lib/plat-mac/MiniAEFrame.py
+2
-1
Lib/plat-mac/PixMapWrapper.py
Lib/plat-mac/PixMapWrapper.py
+5
-4
No files found.
Lib/plat-mac/FrameWork.py
View file @
afeb42e5
...
...
@@ -229,7 +229,7 @@ class Application:
def
asyncevents
(
self
,
onoff
):
"""asyncevents - Set asynchronous event handling on or off"""
if
MacOS
.
runtimemodel
==
'macho'
:
raise
'Unsupported in MachoPython'
raise
NotImplementedError
(
'Unsupported in MachoPython'
)
old
=
self
.
_doing_asyncevents
if
old
:
MacOS
.
SetEventHandler
()
...
...
@@ -577,7 +577,7 @@ class Menu:
def
delitem
(
self
,
item
):
if
item
!=
len
(
self
.
items
):
raise
'Can only delete last item of a menu'
raise
ValueError
(
'Can only delete last item of a menu'
)
self
.
menu
.
DeleteMenuItem
(
item
)
del
self
.
items
[
item
-
1
]
...
...
Lib/plat-mac/MiniAEFrame.py
View file @
afeb42e5
...
...
@@ -141,7 +141,8 @@ class AEServer:
elif
(
'****'
,
'****'
)
in
self
.
ae_handlers
:
_function
=
self
.
ae_handlers
[(
'****'
,
'****'
)]
else
:
raise
'Cannot happen: AE callback without handler'
,
(
_class
,
_type
)
raise
RuntimeError
(
'AE callback without handler: '
+
str
((
_class
,
_type
)))
# XXXX Do key-to-name mapping here
...
...
Lib/plat-mac/PixMapWrapper.py
View file @
afeb42e5
...
...
@@ -93,7 +93,8 @@ class PixMapWrapper:
def
__setattr__
(
self
,
attr
,
val
):
if
attr
==
'baseAddr'
:
raise
'UseErr'
,
"don't assign to .baseAddr -- assign to .data instead"
raise
RuntimeError
(
"don't assign to .baseAddr "
"-- assign to .data instead"
)
elif
attr
==
'data'
:
self
.
__dict__
[
'data'
]
=
val
self
.
_stuff
(
'baseAddr'
,
id
(
self
.
data
)
+
MacOS
.
string_id_to_buffer
)
...
...
@@ -121,7 +122,7 @@ class PixMapWrapper:
return
self
.
_unstuff
(
'rowBytes'
)
&
0x7FFF
elif
attr
==
'bounds'
:
# return bounds in official Left, Top, Right, Bottom order!
return
(
\
return
(
self
.
_unstuff
(
'left'
),
self
.
_unstuff
(
'top'
),
self
.
_unstuff
(
'right'
),
...
...
@@ -161,7 +162,7 @@ class PixMapWrapper:
# so convert if necessary
if
format
!=
imgformat
.
macrgb
and
format
!=
imgformat
.
macrgb16
:
# (LATER!)
raise
"NotImplementedError"
,
"conversion to macrgb or macrgb16"
raise
NotImplementedError
(
"conversion to macrgb or macrgb16"
)
self
.
data
=
s
self
.
bounds
=
(
0
,
0
,
width
,
height
)
self
.
cmpCount
=
3
...
...
@@ -182,7 +183,7 @@ class PixMapWrapper:
return
self
.
data
# otherwise, convert to the requested format
# (LATER!)
raise
"NotImplementedError"
,
"data format conversion"
raise
NotImplementedError
(
"data format conversion"
)
def
fromImage
(
self
,
im
):
"""Initialize this PixMap from a PIL Image object."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment