From 3382ffb1babf7c60d975469d88341294bc9b07c2 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 18 Dec 2023 18:39:23 +0800 Subject: [PATCH] bugfix --- ahserver/filetest.py | 10 ++++++++++ ahserver/globalEnv.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ahserver/filetest.py diff --git a/ahserver/filetest.py b/ahserver/filetest.py new file mode 100644 index 0000000..1ca9f12 --- /dev/null +++ b/ahserver/filetest.py @@ -0,0 +1,10 @@ +import os + +def current_fileno(): + with open(__file__, 'r') as f: + return f.fileno() + +if __name__ == '__main__': + for i in range(1000): + print(current_fileno()) + diff --git a/ahserver/globalEnv.py b/ahserver/globalEnv.py index 21624bf..d98b99d 100755 --- a/ahserver/globalEnv.py +++ b/ahserver/globalEnv.py @@ -28,6 +28,7 @@ from sqlor.crud import CRUD from .xlsxData import XLSXData from .uriop import URIOp from .error import Success, Error, NeedLogin, NoPermission +from .filetest import current_fileno from .serverenv import ServerEnv @@ -167,4 +168,4 @@ def initEnv(): g.NeedLogin = NeedLogin g.NoPermission = NoPermission g.password_encode = password - + g.current_fileno = current_fileno