Jump to content

Fix CursorImage 'NoneType' object is not callable.


Shang

Recommended Posts

Hello, you probably have seen this "warning" in your syserr and probably ignored it:

Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09204630>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09204650>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09204610>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210B30>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092109D0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092109F0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A10>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A30>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A50>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A70>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092104B0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210550>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210590>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092106B0>> ignored
Exception AttributeError: "'NoneType' object has no attribute '__del__'" in <bound method NumberLine.__del__ of <ui.NumberLine object at 0x092106F0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092045D0>> ignored

This is caused by not deleting the CMouseController instance properly.

To fix this we just need to delete the CMouseController instance when closing the client. Let's start:

Open root/mouseModule.py and search for the constructor of CMouseController (CMouseController.__init__) and add this under 'self.callbackDict = {}':

self.cursorDict = {}

Now navigate towards the deconstructor of the same class (CMouseController.__del__) and add this under the 'self.callbackDict = {}':

for k, v in self.cursorDict.items():
	v.DeleteImage()

And the final step is just to delete the instance of the CMouseController from de mouseModule; open prototype.py and add this under 'mainStream.Destroy()':

del mouseModule.mouseController

 

And that's all. If you have any problem related to the post just comment it.

Note: I've started to see this when I compiled the python library as static.

Edited by Shang
  • Metin2 Dev 2
  • Good 2
  • Love 6
Link to comment
Share on other sites

59 minutes ago, Denizeri24 said:

some cursor types missing (e.g MAGIC)

 

That is the problem...

I don't know what you are talking about.

self.cursorDict = {
	app.NORMAL			: CursorImage("D:/Ymir Work/UI/Cursor/cursor.sub"),
	app.ATTACK			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_attack.sub"),
	app.TARGET			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_attack.sub"),
	app.TALK			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_talk.sub"),
	app.CANT_GO			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_no.sub"),
	app.PICK			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_pick.sub"),
	app.DOOR			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_door.sub"),
	app.CHAIR			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_chair.sub"),
	app.MAGIC			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_chair.sub"),
	app.BUY				: CursorImage("D:/Ymir Work/UI/Cursor/cursor_buy.sub"),
	app.SELL			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_sell.sub"),
	app.CAMERA_ROTATE	: CursorImage("D:/Ymir Work/UI/Cursor/cursor_camera_rotate.sub"),
	app.HSIZE			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_hsize.sub"),
	app.VSIZE			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_vsize.sub"),
	app.HVSIZE			: CursorImage("D:/Ymir Work/UI/Cursor/cursor_hvsize.sub"),
}

Every cursor exists inside the client (at least on mine).

Edited by Shang
Link to comment
Share on other sites

  • 1 year later...
On 9/28/2021 at 11:58 AM, Shang said:

Hello, you probably have seen this "warning" in your syserr and probably ignored it:

Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09204630>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09204650>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09204610>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210B30>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092109D0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092109F0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A10>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A30>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A50>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210A70>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092104B0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210550>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x09210590>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092106B0>> ignored
Exception AttributeError: "'NoneType' object has no attribute '__del__'" in <bound method NumberLine.__del__ of <ui.NumberLine object at 0x092106F0>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method CursorImage.__del__ of <mouseModule.CursorImage object at 0x092045D0>> ignored

This is caused by not deleting the CMouseController instance properly.

To fix this we just need to delete the CMouseController instance when closing the client. Let's start:

Open root/mouseModule.py and search for the constructor of CMouseController (CMouseController.__init__) and add this under 'self.callbackDict = {}':

self.cursorDict = {}

Now navigate towards the deconstructor of the same class (CMouseController.__del__) and add this under the 'self.callbackDict = {}':

for k, v in self.cursorDict.items():
	v.DeleteImage()

And the final step is just to delete the instance of the CMouseController from de mouseModule; open prototype.py and add this under 'mainStream.Destroy()':

del mouseModule.mouseController

 

And that's all. If you have any problem related to the post just comment it.

Note: I've started to see this when I compiled the python library as static.

This is pretty bad fix.. He have true, in source is diff, I have already fixed this..

  • Confused 1
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.