Skip to content

Commit

Permalink
Avoid more cyclic imports on the session file
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jan 8, 2018
1 parent f418237 commit 3c686fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions telethon/tl/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import os
import platform
import sqlite3
import struct
import time
from base64 import b64decode
from os.path import isfile as file_exists
from threading import Lock

from .. import utils, helpers
from .. import utils
from ..tl import TLObject
from ..tl.types import (
PeerUser, PeerChat, PeerChannel,
Expand Down Expand Up @@ -62,7 +63,7 @@ def __init__(self, session_id):
self.save_entities = True
self.flood_sleep_threshold = 60

self.id = helpers.generate_random_long(signed=True)
self.id = struct.unpack('q', os.urandom(8))[0]
self._sequence = 0
self.time_offset = 0
self._last_msg_id = 0 # Long
Expand Down

0 comments on commit 3c686fe

Please sign in to comment.