Skip to content

Featured Replies

Morning all. Today, i add a npc and i get little errors in init.py, in L2DatabaseFactory. In console, error is 

 

  File "custom/50300_PKlist/__init__.py", line 58, in onEvent
AttributeError: class 'com.l2jserver.L2DatabaseFactory' has no attribute 'close'

and in init.py is setted 

L2DatabaseFactory.close(con)

Thank you!

Guess error is clear. Check other .py files if they are using the db connection and see how to close it / check the file itself for the method.

Anyway, you should not use old .py files. 

as sweets said you can open another .py file to see how database connections are closing connection.

you can try this one

try : con.close()
except : pass

 

Edited by melron

  • Author
Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('inconsistent dedent', ('custom/50300_PKlist/__init__.py', 58, 15, '              con.close()\t\t '))

No work 

con.close()

 

Edited by InFocus

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.